Skip to content

Commit

Permalink
Update to use chain_api().execute_with
Browse files Browse the repository at this point in the history
kvinwang committed Nov 7, 2023
1 parent e6050a1 commit 85cdf0d
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions e2e/contracts/check_system/lib.rs
Original file line number Diff line number Diff line change
@@ -187,6 +187,7 @@ mod check_system {
#[cfg(test)]
mod tests {
use drink::session::Session;
use drink::chain_api::ChainApi;
use drink_pink_runtime::{ExecMode, PinkRuntime};
use ink::codegen::TraitCallBuilder;

@@ -199,7 +200,7 @@ mod check_system {
#[drink::test]
fn it_works() -> Result<(), Box<dyn std::error::Error>> {
let mut session = Session::<PinkRuntime>::new()?;
session.execute_with(|| {
session.chain_api().execute_with(|| {
PinkRuntime::setup_cluster().expect("Failed to setup cluster");
});

@@ -254,7 +255,10 @@ mod check_system {
},
primitives::Hash,
};
use drink::{errors::MessageResult, runtime::Runtime, session::Session, ContractBundle};
use drink::{
chain_api::ChainApi, errors::MessageResult, runtime::Runtime, session::Session,
ContractBundle,
};
use drink_pink_runtime::PinkRuntime;
use pink_extension::{Balance, ConvertTo};
use scale::{Decode, Encode};
@@ -281,7 +285,7 @@ mod check_system {
Args: Encode,
Env::AccountId: From<[u8; 32]>,
{
session.execute_with(move || {
session.chain_api().execute_with(move || {
let caller = PinkRuntime::default_actor();
let code_hash = PinkRuntime::upload_code(caller.clone(), bundle.wasm, true)?;
let constructor = constructor
@@ -318,7 +322,7 @@ mod check_system {
Args: Encode,
Ret: Decode,
{
session.execute_with(move || {
session.chain_api().execute_with(move || {
let origin = PinkRuntime::default_actor();
let params = call_builder.params();
let data = params.exec_input().encode();

0 comments on commit 85cdf0d

Please sign in to comment.