Skip to content

Commit

Permalink
Merge branch 'main' into feat/remove-multiple-chain-support
Browse files Browse the repository at this point in the history
  • Loading branch information
talalashraf authored Sep 24, 2024
2 parents 2ac79d7 + 481d84b commit 61ef22e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
13 changes: 8 additions & 5 deletions sui/gateway.js
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,8 @@ async function callContract(keypair, client, config, chain, contractConfig, args
});
}

tx.moveCall({
target: `${packageId}::gateway::call_contract`,
const messageTicket = tx.moveCall({
target: `${packageId}::gateway::prepare_message`,
arguments: [
channel,
tx.pure(bcs.string().serialize(destinationChain).toBytes()),
Expand All @@ -126,16 +126,19 @@ async function callContract(keypair, client, config, chain, contractConfig, args
],
});

tx.moveCall({
target: `${packageId}::gateway::send_message`,
arguments: [messageTicket],
});

if (!options.channel) {
tx.moveCall({
target: `${packageId}::channel::destroy`,
arguments: [channel],
});
}

await broadcast(client, keypair, tx);

printInfo('Contract called');
await broadcast(client, keypair, tx, 'Message sent');
}

async function approveMessages(keypair, client, config, chain, contractConfig, args, options) {
Expand Down
4 changes: 1 addition & 3 deletions sui/utils/sign-utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -110,9 +110,7 @@ async function broadcast(client, keypair, tx, actionName) {
},
});

if (actionName) {
printInfo(actionName, receipt.digest);
}
printInfo(actionName || 'Tx', receipt.digest);

return receipt;
}
Expand Down

0 comments on commit 61ef22e

Please sign in to comment.