Skip to content

Commit

Permalink
merge main branch
Browse files Browse the repository at this point in the history
  • Loading branch information
volovyks committed Jun 6, 2022
2 parents bd61b96 + 516c74b commit d5a422c
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion examples/cross-contract-call/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ near js deploy --accountId <accountId> --base64File <contract-name>.base64 --dep
<p>

export NEAR_ENV=local
near call jsvm.test.near deploy_js_contract --accountId <accoundId> --args $(cat <contract-name>.base64) --base64 --deposit 0.1
near call jsvm.test.near deploy_js_contract --accountId <accountId> --args $(cat <contract-name>.base64) --base64 --deposit 0.1

</p>
</details>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ test.afterEach(async t => {

test('Root gets null status', async t => {
const { root, jsvm, statusMessage } = t.context.accounts;
const result = await jsvm.view('view_js_contract', encodeCall(statusMessage.accountId, 'get_status', { accound_id: root.accountId }));
const result = await jsvm.view('view_js_contract', encodeCall(statusMessage.accountId, 'get_status', { account_id: root.accountId }));
t.is(result, null);
});

Expand All @@ -52,7 +52,7 @@ test('Ali sets then gets status', async t => {
await ali.call(jsvm, 'call_js_contract', encodeCall(statusMessage.accountId, 'set_status', { message: 'hello' }), { attachedDeposit: '100000000000000000000000' });

t.is(
await jsvm.view('view_js_contract', encodeCall(statusMessage.accountId, 'get_status', { accound_id: ali.accountId })),
await jsvm.view('view_js_contract', encodeCall(statusMessage.accountId, 'get_status', { account_id: ali.accountId })),
'hello'
);
});
Expand All @@ -62,8 +62,8 @@ test('Bob and Carl have different statuses', async t => {
await bob.call(jsvm, 'call_js_contract', encodeCall(statusMessage.accountId, 'set_status', { message: 'hello' }), { attachedDeposit: '100000000000000000000000' });
await carl.call(jsvm, 'call_js_contract', encodeCall(statusMessage.accountId, 'set_status', { message: 'world' }), { attachedDeposit: '100000000000000000000000' });

const bobStatus = await jsvm.view('view_js_contract', encodeCall(statusMessage.accountId, 'get_status', { accound_id: bob.accountId }));
const carlStatus = await jsvm.view('view_js_contract', encodeCall(statusMessage.accountId, 'get_status', { accound_id: carl.accountId }));
const bobStatus = await jsvm.view('view_js_contract', encodeCall(statusMessage.accountId, 'get_status', { account_id: bob.accountId }));
const carlStatus = await jsvm.view('view_js_contract', encodeCall(statusMessage.accountId, 'get_status', { account_id: carl.accountId }));
t.is(bobStatus, 'hello');
t.is(carlStatus, 'world');
});
Expand Down
8 changes: 4 additions & 4 deletions examples/status-message/__tests__/test-status-message.ava.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ test.after(async t => {

test('Root gets null status', async t => {
const { root, jsvm, statusMessage } = t.context.accounts;
const result = await jsvm.view('view_js_contract', encodeCall(statusMessage.accountId, 'get_status', { accound_id: root.accountId }));
const result = await jsvm.view('view_js_contract', encodeCall(statusMessage.accountId, 'get_status', { account_id: root.accountId }));
t.is(result, null);
});

Expand All @@ -52,7 +52,7 @@ test('Ali sets then gets status', async t => {
await ali.call(jsvm, 'call_js_contract', encodeCall(statusMessage.accountId, 'set_status', { message: 'hello' }), { attachedDeposit: '100000000000000000000000' });

t.is(
await jsvm.view('view_js_contract', encodeCall(statusMessage.accountId, 'get_status', { accound_id: ali.accountId })),
await jsvm.view('view_js_contract', encodeCall(statusMessage.accountId, 'get_status', { account_id: ali.accountId })),
'hello'
);
});
Expand All @@ -62,8 +62,8 @@ test('Bob and Carl have different statuses', async t => {
await bob.call(jsvm, 'call_js_contract', encodeCall(statusMessage.accountId, 'set_status', { message: 'hello' }), { attachedDeposit: '100000000000000000000000' });
await carl.call(jsvm, 'call_js_contract', encodeCall(statusMessage.accountId, 'set_status', { message: 'world' }), { attachedDeposit: '100000000000000000000000' });

const bobStatus = await jsvm.view('view_js_contract', encodeCall(statusMessage.accountId, 'get_status', { accound_id: bob.accountId }));
const carlStatus = await jsvm.view('view_js_contract', encodeCall(statusMessage.accountId, 'get_status', { accound_id: carl.accountId }));
const bobStatus = await jsvm.view('view_js_contract', encodeCall(statusMessage.accountId, 'get_status', { account_id: bob.accountId }));
const carlStatus = await jsvm.view('view_js_contract', encodeCall(statusMessage.accountId, 'get_status', { account_id: carl.accountId }));
t.is(bobStatus, 'hello');
t.is(carlStatus, 'world');
});

0 comments on commit d5a422c

Please sign in to comment.