@@ -8,42 +8,42 @@ describe('[Common]: Parameter instantiation / params option / Updates', () => {
8
8
it ( 'Param option' , ( ) => {
9
9
const c = new Common ( { chain : Mainnet , params : paramsTest } )
10
10
let msg = 'Should also work with parameters passed with params option'
11
- assert . equal ( c . param ( 'ecAddGas ' ) , BigInt ( 150 ) , msg )
11
+ assert . equal ( c . param ( 'bn254AddGas ' ) , BigInt ( 150 ) , msg )
12
12
13
13
const params = {
14
14
1679 : {
15
- ecAddGas : 250 ,
15
+ bn254AddGas : 250 ,
16
16
} ,
17
17
}
18
18
c . updateParams ( params )
19
19
msg = 'Should update parameter on updateParams() and properly rebuild cache'
20
- assert . equal ( c . param ( 'ecAddGas ' ) , BigInt ( 250 ) , msg )
20
+ assert . equal ( c . param ( 'bn254AddGas ' ) , BigInt ( 250 ) , msg )
21
21
22
22
c . resetParams ( params )
23
23
msg = 'Should reset all parameters on resetParams() and properly rebuild cache'
24
- assert . equal ( c . param ( 'ecAddGas ' ) , BigInt ( 250 ) , msg )
24
+ assert . equal ( c . param ( 'bn254AddGas ' ) , BigInt ( 250 ) , msg )
25
25
assert . throws ( ( ) => {
26
- c . param ( 'ecMulGas ' ) , BigInt ( 250 )
26
+ c . param ( 'bn254MulGas ' ) , BigInt ( 250 )
27
27
} )
28
28
29
29
msg = 'Should not side-manipulate the original params file during updating internally'
30
- assert . equal ( paramsTest [ '1679' ] [ 'ecAddGas ' ] , 150 )
30
+ assert . equal ( paramsTest [ '1679' ] [ 'bn254AddGas ' ] , 150 )
31
31
} )
32
32
} )
33
33
34
34
describe ( '[Common]: Parameter access for param(), paramByHardfork()' , ( ) => {
35
35
it ( 'Basic usage' , ( ) => {
36
36
const c = new Common ( { chain : Mainnet , params : paramsTest , eips : [ 2537 ] } )
37
37
let msg = 'Should return correct value when HF directly provided'
38
- assert . equal ( c . paramByHardfork ( 'ecAddGas ' , 'byzantium' ) , BigInt ( 500 ) , msg )
38
+ assert . equal ( c . paramByHardfork ( 'bn254AddGas ' , 'byzantium' ) , BigInt ( 500 ) , msg )
39
39
40
40
msg = 'Should return correct value for HF set in class'
41
41
c . setHardfork ( Hardfork . Byzantium )
42
- assert . equal ( c . param ( 'ecAddGas ' ) , BigInt ( 500 ) , msg )
42
+ assert . equal ( c . param ( 'bn254AddGas ' ) , BigInt ( 500 ) , msg )
43
43
c . setHardfork ( Hardfork . Istanbul )
44
- assert . equal ( c . param ( 'ecAddGas ' ) , BigInt ( 150 ) , msg )
44
+ assert . equal ( c . param ( 'bn254AddGas ' ) , BigInt ( 150 ) , msg )
45
45
c . setHardfork ( Hardfork . MuirGlacier )
46
- assert . equal ( c . param ( 'ecAddGas ' ) , BigInt ( 150 ) , msg )
46
+ assert . equal ( c . param ( 'bn254AddGas ' ) , BigInt ( 150 ) , msg )
47
47
48
48
assert . throws ( ( ) => {
49
49
c . paramByHardfork ( 'notExistingValue' , 'byzantium' )
@@ -55,7 +55,7 @@ describe('[Common]: Parameter access for param(), paramByHardfork()', () => {
55
55
// To run please manually add an "ecAdd" entry with value 12345 to EIP2537 config
56
56
// and uncomment the test
57
57
msg = 'EIP config should take precedence over HF config'
58
- assert.equal(c.param('ecAddGas '), 12345, msg)
58
+ assert.equal(c.param('bn254AddGas '), 12345, msg)
59
59
*/
60
60
} )
61
61
@@ -64,7 +64,7 @@ describe('[Common]: Parameter access for param(), paramByHardfork()', () => {
64
64
65
65
c . setHardfork ( Hardfork . Byzantium )
66
66
assert . equal (
67
- c . param ( 'ecAddGas ' ) ,
67
+ c . param ( 'bn254AddGas ' ) ,
68
68
BigInt ( 500 ) ,
69
69
'Should return correct value for HF set in class' ,
70
70
)
@@ -123,12 +123,12 @@ describe('[Common]: Parameter access for param(), paramByHardfork()', () => {
123
123
124
124
const UNSUPPORTED_EIP = 1000000
125
125
const f = function ( ) {
126
- c . paramByEIP ( 'Bls12381G1AddGas ' , UNSUPPORTED_EIP )
126
+ c . paramByEIP ( 'bls12381G1AddGas ' , UNSUPPORTED_EIP )
127
127
}
128
128
let msg = 'Should throw for using paramByEIP() with an unsupported EIP'
129
129
assert . throws ( f , / n o t s u p p o r t e d $ / , undefined , msg )
130
130
131
- msg = 'Should return Bls12381G1AddGas gas price for EIP2537'
132
- assert . equal ( c . paramByEIP ( 'Bls12381G1AddGas ' , 2537 ) , BigInt ( 500 ) , msg )
131
+ msg = 'Should return bls12381G1AddGas gas price for EIP2537'
132
+ assert . equal ( c . paramByEIP ( 'bls12381G1AddGas ' , 2537 ) , BigInt ( 500 ) , msg )
133
133
} )
134
134
} )
0 commit comments