Skip to content

Commit

Permalink
Make tests pass again
Browse files Browse the repository at this point in the history
vgrichina committed Dec 8, 2023

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
1 parent c673c0f commit e8adc68
Showing 2 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion app.js
Original file line number Diff line number Diff line change
@@ -212,7 +212,7 @@ router.post('/web4/contract/:contractId/:methodName', withNear, withAccountId, r
} else {
const { status } = result;

if (status?.SuccessValue) {
if (status?.SuccessValue !== undefined) {
const callResult = Buffer.from(status.SuccessValue, 'base64')
debug('Call succeeded with result', callResult);
// TODO: Detect content type from returned result
7 changes: 5 additions & 2 deletions test/app.test.js
Original file line number Diff line number Diff line change
@@ -321,6 +321,9 @@ function mockTransactionSuccess(receiverId, methodName, callback) {
jsonrpc: '2.0',
id: body.id,
result: {
status: {
SuccessValue: '',
},
transaction_outcome: {
outcome: {
logs: [],
@@ -349,8 +352,8 @@ test('/web4/contract/test.near/web4_setStaticUrl method call with key in cookie'
.send({ url: 'test://url' });

t.equal(res.status, 200);
// TODO: Decide what exactly to return
t.equal(res.text, '{"transaction_outcome":{"outcome":{"logs":[],"status":{},"receipt_ids":[]}},"receipts_outcome":[]}');
// TODO: Test failure case
t.equal(res.text, '');
});

test('/web4/contract/test.near/setNestedObject method call with nested object in form data', async t => {

0 comments on commit e8adc68

Please sign in to comment.