|
|
@ -1219,7 +1219,7 @@ describe('Transaction Controller', function () { |
|
|
|
category: 'Transactions', |
|
|
|
category: 'Transactions', |
|
|
|
sensitiveProperties: { |
|
|
|
sensitiveProperties: { |
|
|
|
chain_id: '0x2a', |
|
|
|
chain_id: '0x2a', |
|
|
|
gas_price: '0x77359400', |
|
|
|
gas_price: '2', |
|
|
|
gas_limit: '0x7b0d', |
|
|
|
gas_limit: '0x7b0d', |
|
|
|
first_seen: 1624408066355, |
|
|
|
first_seen: 1624408066355, |
|
|
|
transaction_envelope_type: 'legacy', |
|
|
|
transaction_envelope_type: 'legacy', |
|
|
@ -1264,7 +1264,7 @@ describe('Transaction Controller', function () { |
|
|
|
category: 'Transactions', |
|
|
|
category: 'Transactions', |
|
|
|
sensitiveProperties: { |
|
|
|
sensitiveProperties: { |
|
|
|
chain_id: '0x2a', |
|
|
|
chain_id: '0x2a', |
|
|
|
gas_price: '0x77359400', |
|
|
|
gas_price: '2', |
|
|
|
gas_limit: '0x7b0d', |
|
|
|
gas_limit: '0x7b0d', |
|
|
|
first_seen: 1624408066355, |
|
|
|
first_seen: 1624408066355, |
|
|
|
transaction_envelope_type: 'legacy', |
|
|
|
transaction_envelope_type: 'legacy', |
|
|
@ -1311,7 +1311,7 @@ describe('Transaction Controller', function () { |
|
|
|
baz: 3.0, |
|
|
|
baz: 3.0, |
|
|
|
foo: 'bar', |
|
|
|
foo: 'bar', |
|
|
|
chain_id: '0x2a', |
|
|
|
chain_id: '0x2a', |
|
|
|
gas_price: '0x77359400', |
|
|
|
gas_price: '2', |
|
|
|
gas_limit: '0x7b0d', |
|
|
|
gas_limit: '0x7b0d', |
|
|
|
first_seen: 1624408066355, |
|
|
|
first_seen: 1624408066355, |
|
|
|
transaction_envelope_type: 'legacy', |
|
|
|
transaction_envelope_type: 'legacy', |
|
|
@ -1363,8 +1363,8 @@ describe('Transaction Controller', function () { |
|
|
|
baz: 3.0, |
|
|
|
baz: 3.0, |
|
|
|
foo: 'bar', |
|
|
|
foo: 'bar', |
|
|
|
chain_id: '0x2a', |
|
|
|
chain_id: '0x2a', |
|
|
|
max_fee_per_gas: '0x77359400', |
|
|
|
max_fee_per_gas: '2', |
|
|
|
max_priority_fee_per_gas: '0x77359400', |
|
|
|
max_priority_fee_per_gas: '2', |
|
|
|
gas_limit: '0x7b0d', |
|
|
|
gas_limit: '0x7b0d', |
|
|
|
first_seen: 1624408066355, |
|
|
|
first_seen: 1624408066355, |
|
|
|
transaction_envelope_type: 'fee-market', |
|
|
|
transaction_envelope_type: 'fee-market', |
|
|
@ -1415,4 +1415,30 @@ describe('Transaction Controller', function () { |
|
|
|
assert.equal(result, '21'); |
|
|
|
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); |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
}); |
|
|
|
}); |
|
|
|
}); |
|
|
|