Skip to content

Commit cedd676

Browse files
committed
Properly test fallback functions in abi translator
1 parent bcb3944 commit cedd676

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

test/abi.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,14 @@ tape('ABI translator', function (t) {
2525
st.deepEqual(abi.update('0.3.6', input), [ { inputs: [], type: 'event' }, { payable: true, stateMutability: 'payable', type: 'fallback' } ]);
2626
st.end();
2727
});
28-
t.test('0.4.0 (has fallback)', function (st) {
28+
t.test('0.3.6 (has no fallback)', function (st) {
2929
var input = [ { inputs: [], type: 'constructor' } ];
30-
st.deepEqual(abi.update('0.4.0', input), [ { inputs: [], payable: true, stateMutability: 'payable', type: 'constructor' } ]);
30+
st.deepEqual(abi.update('0.3.6', input), [ { inputs: [], type: 'constructor', payable: true, stateMutability: 'payable' }, { type: 'fallback', payable: true, stateMutability: 'payable' } ]);
31+
st.end();
32+
});
33+
t.test('0.4.0 (has fallback)', function (st) {
34+
var input = [ { inputs: [], type: 'constructor' }, { type: 'fallback' } ];
35+
st.deepEqual(abi.update('0.4.0', input), [ { inputs: [], type: 'constructor', payable: true, stateMutability: 'payable' }, { type: 'fallback', stateMutability: 'nonpayable' } ]);
3136
st.end();
3237
});
3338
t.test('0.4.0 (constant function)', function (st) {

0 commit comments

Comments
 (0)