Skip to content

Commit e8adc68

Browse files
committed
Make tests pass again
1 parent c673c0f commit e8adc68

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

app.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ router.post('/web4/contract/:contractId/:methodName', withNear, withAccountId, r
212212
} else {
213213
const { status } = result;
214214

215-
if (status?.SuccessValue) {
215+
if (status?.SuccessValue !== undefined) {
216216
const callResult = Buffer.from(status.SuccessValue, 'base64')
217217
debug('Call succeeded with result', callResult);
218218
// TODO: Detect content type from returned result

test/app.test.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -321,6 +321,9 @@ function mockTransactionSuccess(receiverId, methodName, callback) {
321321
jsonrpc: '2.0',
322322
id: body.id,
323323
result: {
324+
status: {
325+
SuccessValue: '',
326+
},
324327
transaction_outcome: {
325328
outcome: {
326329
logs: [],
@@ -349,8 +352,8 @@ test('/web4/contract/test.near/web4_setStaticUrl method call with key in cookie'
349352
.send({ url: 'test://url' });
350353

351354
t.equal(res.status, 200);
352-
// TODO: Decide what exactly to return
353-
t.equal(res.text, '{"transaction_outcome":{"outcome":{"logs":[],"status":{},"receipt_ids":[]}},"receipts_outcome":[]}');
355+
// TODO: Test failure case
356+
t.equal(res.text, '');
354357
});
355358

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

0 commit comments

Comments
 (0)