@@ -15,11 +15,16 @@ tape('ABI translator', function (t) {
15
15
st . deepEqual ( abi . update ( '0.3.6' , input ) , [ { inputs : [ ] , payable : true , stateMutability : 'payable' , type : 'constructor' } , { payable : true , stateMutability : 'payable' , type : 'fallback' } ] ) ;
16
16
st . end ( ) ;
17
17
} ) ;
18
- t . test ( '0.3.6 (function)' , function ( st ) {
18
+ t . test ( '0.3.6 (non-constant function)' , function ( st ) {
19
19
var input = [ { inputs : [ ] , type : 'function' } ] ;
20
20
st . deepEqual ( abi . update ( '0.3.6' , input ) , [ { inputs : [ ] , payable : true , stateMutability : 'payable' , type : 'function' } , { payable : true , stateMutability : 'payable' , type : 'fallback' } ] ) ;
21
21
st . end ( ) ;
22
22
} ) ;
23
+ t . test ( '0.3.6 (constant function)' , function ( st ) {
24
+ var input = [ { inputs : [ ] , type : 'function' , constant : true } ] ;
25
+ st . deepEqual ( abi . update ( '0.3.6' , input ) , [ { inputs : [ ] , constant : true , stateMutability : 'view' , type : 'function' } , { payable : true , stateMutability : 'payable' , type : 'fallback' } ] ) ;
26
+ st . end ( ) ;
27
+ } ) ;
23
28
t . test ( '0.3.6 (event)' , function ( st ) {
24
29
var input = [ { inputs : [ ] , type : 'event' } ] ;
25
30
st . deepEqual ( abi . update ( '0.3.6' , input ) , [ { inputs : [ ] , type : 'event' } , { payable : true , stateMutability : 'payable' , type : 'fallback' } ] ) ;
@@ -35,11 +40,21 @@ tape('ABI translator', function (t) {
35
40
st . deepEqual ( abi . update ( '0.4.0' , input ) , [ { inputs : [ ] , type : 'constructor' , payable : true , stateMutability : 'payable' } , { type : 'fallback' , stateMutability : 'nonpayable' } ] ) ;
36
41
st . end ( ) ;
37
42
} ) ;
43
+ t . test ( '0.4.0 (non-constant function)' , function ( st ) {
44
+ var input = [ { inputs : [ ] , type : 'function' } ] ;
45
+ st . deepEqual ( abi . update ( '0.4.0' , input ) , [ { inputs : [ ] , stateMutability : 'nonpayable' , type : 'function' } ] ) ;
46
+ st . end ( ) ;
47
+ } ) ;
38
48
t . test ( '0.4.0 (constant function)' , function ( st ) {
39
49
var input = [ { inputs : [ ] , type : 'function' , constant : true } ] ;
40
50
st . deepEqual ( abi . update ( '0.4.0' , input ) , [ { inputs : [ ] , constant : true , stateMutability : 'view' , type : 'function' } ] ) ;
41
51
st . end ( ) ;
42
52
} ) ;
53
+ t . test ( '0.4.0 (payable function)' , function ( st ) {
54
+ var input = [ { inputs : [ ] , payable : true , type : 'function' } ] ;
55
+ st . deepEqual ( abi . update ( '0.4.0' , input ) , [ { inputs : [ ] , payable : true , stateMutability : 'payable' , type : 'function' } ] ) ;
56
+ st . end ( ) ;
57
+ } ) ;
43
58
t . test ( '0.4.1 (constructor not payable)' , function ( st ) {
44
59
var input = [ { inputs : [ ] , payable : false , type : 'constructor' } ] ;
45
60
st . deepEqual ( abi . update ( '0.4.1' , input ) , [ { inputs : [ ] , payable : true , stateMutability : 'payable' , type : 'constructor' } ] ) ;
0 commit comments