Skip to content

Commit

Permalink
cross-contrac-call test fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
volovyks committed Jun 2, 2022
1 parent f1ec32f commit 6f614a3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ test('Person can be set on-call if AVAILABLE', async t => {
const { ali, bob, jsvm, statusMessageContract, onCallContract } = t.context.accounts;

// Ali set her status as AVAILABLE
await ali.call(jsvm, 'call_js_contract', encodeCall(statusMessageContract.accountId, 'set_status', { status: 'AVAILABLE' }), { attachedDeposit: '100000000000000000000000' });
await ali.call(jsvm, 'call_js_contract', encodeCall(statusMessageContract.accountId, 'set_status', { message: 'AVAILABLE' }), { attachedDeposit: '100000000000000000000000' });
// Bob sets Ali on-call
await bob.call(jsvm, 'call_js_contract', encodeCall(onCallContract.accountId, 'set_person_on_call', { accountId: ali.accountId }), { attachedDeposit: '100000000000000000000000' });

Expand All @@ -79,7 +79,7 @@ test('Person can NOT be set on-call if UNAVAILABLE', async t => {
const { ali, bob, jsvm, statusMessageContract, onCallContract } = t.context.accounts;

// Ali set her status as AVAILABLE
await ali.call(jsvm, 'call_js_contract', encodeCall(statusMessageContract.accountId, 'set_status', { status: 'UNAVAILABLE' }), { attachedDeposit: '100000000000000000000000' });
await ali.call(jsvm, 'call_js_contract', encodeCall(statusMessageContract.accountId, 'set_status', { message: 'UNAVAILABLE' }), { attachedDeposit: '100000000000000000000000' });
// Bob tries to sets Ali on-call
await bob.call(jsvm, 'call_js_contract', encodeCall(onCallContract.accountId, 'set_person_on_call', { accountId: ali.accountId }), { attachedDeposit: '100000000000000000000000' });

Expand Down
2 changes: 1 addition & 1 deletion examples/cross-contract-call/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class OnCall extends NearContract {
@call
set_person_on_call({ accountId }) {
near.log(`Trying to set ${accountId} on-call`)
const status = near.jsvmCall('status-message.test.near', 'get_status', [accountId])
const status = near.jsvmCall('status-message.test.near', 'get_status', { account_id: accountId })
near.log(`${accountId} status is ${status}`)
if (status === 'AVAILABLE') {
this.personOnCall = accountId
Expand Down

0 comments on commit 6f614a3

Please sign in to comment.