Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
stedfn committed Feb 11, 2025
1 parent 6500dde commit b4c4c2f
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -118,14 +118,21 @@ fn test_global_contract(
&rpc_id,
&accounts[0],
contract.code().into(),
deploy_mode,
deploy_mode.clone(),
nonce,
);
nonce += 1;
env.test_loop.run_for(Duration::seconds(3));
check_txs(&env.test_loop.data, &env.datas, &rpc_id, &[deploy_tx]);
let code_hash = CryptoHash::hash_bytes(contract.code());
let identifier = GlobalContractIdentifier::CodeHash(code_hash);
let identifier = match deploy_mode {
GlobalContractDeployMode::CodeHash => {
let code_hash = CryptoHash::hash_bytes(contract.code());
GlobalContractIdentifier::CodeHash(code_hash)
}
GlobalContractDeployMode::AccountId => {
GlobalContractIdentifier::AccountId(accounts[0].clone())
}
};
// test on accounts from different shards
for account in [&accounts[1], &accounts[6]] {
let use_tx = use_global_contract(
Expand Down
1 change: 1 addition & 0 deletions runtime/runtime/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -493,6 +493,7 @@ impl Runtime {
Action::FunctionCall(function_call) => {
let account = account.as_mut().expect(EXPECT_ACCOUNT_EXISTS);
let account_contract = account.contract();

let code_hash = match account_contract.as_ref() {
AccountContract::None => CryptoHash::default(),
AccountContract::Local(code_hash) | AccountContract::Global(code_hash) => {
Expand Down

0 comments on commit b4c4c2f

Please sign in to comment.