|
|
|
@ -1214,7 +1214,7 @@ describe('Transaction Controller', function () { |
|
|
|
|
category: 'Transactions', |
|
|
|
|
sensitiveProperties: { |
|
|
|
|
chain_id: '0x2a', |
|
|
|
|
gas_price: '0x77359400', |
|
|
|
|
gas_price: '2', |
|
|
|
|
gas_limit: '0x7b0d', |
|
|
|
|
first_seen: 1624408066355, |
|
|
|
|
transaction_envelope_type: 'legacy', |
|
|
|
@ -1259,7 +1259,7 @@ describe('Transaction Controller', function () { |
|
|
|
|
category: 'Transactions', |
|
|
|
|
sensitiveProperties: { |
|
|
|
|
chain_id: '0x2a', |
|
|
|
|
gas_price: '0x77359400', |
|
|
|
|
gas_price: '2', |
|
|
|
|
gas_limit: '0x7b0d', |
|
|
|
|
first_seen: 1624408066355, |
|
|
|
|
transaction_envelope_type: 'legacy', |
|
|
|
@ -1306,7 +1306,7 @@ describe('Transaction Controller', function () { |
|
|
|
|
baz: 3.0, |
|
|
|
|
foo: 'bar', |
|
|
|
|
chain_id: '0x2a', |
|
|
|
|
gas_price: '0x77359400', |
|
|
|
|
gas_price: '2', |
|
|
|
|
gas_limit: '0x7b0d', |
|
|
|
|
first_seen: 1624408066355, |
|
|
|
|
transaction_envelope_type: 'legacy', |
|
|
|
@ -1358,8 +1358,8 @@ describe('Transaction Controller', function () { |
|
|
|
|
baz: 3.0, |
|
|
|
|
foo: 'bar', |
|
|
|
|
chain_id: '0x2a', |
|
|
|
|
max_fee_per_gas: '0x77359400', |
|
|
|
|
max_priority_fee_per_gas: '0x77359400', |
|
|
|
|
max_fee_per_gas: '2', |
|
|
|
|
max_priority_fee_per_gas: '2', |
|
|
|
|
gas_limit: '0x7b0d', |
|
|
|
|
first_seen: 1624408066355, |
|
|
|
|
transaction_envelope_type: 'fee-market', |
|
|
|
@ -1410,4 +1410,30 @@ describe('Transaction Controller', function () { |
|
|
|
|
assert.equal(result, '21'); |
|
|
|
|
}); |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
describe('#_getGasValuesInGWEI', function () { |
|
|
|
|
it('converts gas values in hex GWEi to dec GWEI (EIP-1559)', function () { |
|
|
|
|
const params = { |
|
|
|
|
max_fee_per_gas: '0x77359400', |
|
|
|
|
max_priority_fee_per_gas: '0x77359400', |
|
|
|
|
}; |
|
|
|
|
const expectedParams = { |
|
|
|
|
max_fee_per_gas: '2', |
|
|
|
|
max_priority_fee_per_gas: '2', |
|
|
|
|
}; |
|
|
|
|
const result = txController._getGasValuesInGWEI(params); |
|
|
|
|
assert.deepEqual(result, expectedParams); |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
it('converts gas values in hex GWEi to dec GWEI (non EIP-1559)', function () { |
|
|
|
|
const params = { |
|
|
|
|
gas_price: '0x37e11d600', |
|
|
|
|
}; |
|
|
|
|
const expectedParams = { |
|
|
|
|
gas_price: '15', |
|
|
|
|
}; |
|
|
|
|
const result = txController._getGasValuesInGWEI(params); |
|
|
|
|
assert.deepEqual(result, expectedParams); |
|
|
|
|
}); |
|
|
|
|
}); |
|
|
|
|
}); |
|
|
|
|