Skip to content

Commit

Permalink
Merge pull request #178 from ethereum/abi-tests
Browse files Browse the repository at this point in the history
Properly test fallback functions in abi translator
  • Loading branch information
axic authored Feb 9, 2018
2 parents bcb3944 + cedd676 commit b863446
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions test/abi.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,14 @@ tape('ABI translator', function (t) {
st.deepEqual(abi.update('0.3.6', input), [ { inputs: [], type: 'event' }, { payable: true, stateMutability: 'payable', type: 'fallback' } ]);
st.end();
});
t.test('0.4.0 (has fallback)', function (st) {
t.test('0.3.6 (has no fallback)', function (st) {
var input = [ { inputs: [], type: 'constructor' } ];
st.deepEqual(abi.update('0.4.0', input), [ { inputs: [], payable: true, stateMutability: 'payable', type: 'constructor' } ]);
st.deepEqual(abi.update('0.3.6', input), [ { inputs: [], type: 'constructor', payable: true, stateMutability: 'payable' }, { type: 'fallback', payable: true, stateMutability: 'payable' } ]);
st.end();
});
t.test('0.4.0 (has fallback)', function (st) {
var input = [ { inputs: [], type: 'constructor' }, { type: 'fallback' } ];
st.deepEqual(abi.update('0.4.0', input), [ { inputs: [], type: 'constructor', payable: true, stateMutability: 'payable' }, { type: 'fallback', stateMutability: 'nonpayable' } ]);
st.end();
});
t.test('0.4.0 (constant function)', function (st) {
Expand Down

0 comments on commit b863446

Please sign in to comment.