@@ -101,7 +101,7 @@ type UnrestrictedMessenger = Messenger<
101
101
102
102
const MOCK_V1_UUID = '9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d' ;
103
103
const TRANSACTION_HASH_MOCK = '0x123456' ;
104
-
104
+ const MINIMUM_GAS_LIMIT = '0x5208' ;
105
105
jest . mock ( '@metamask/eth-query' ) ;
106
106
jest . mock ( './api/accounts-api' ) ;
107
107
jest . mock ( './gas-flows/DefaultGasFeeFlow' ) ;
@@ -212,7 +212,7 @@ function buildMockEthQuery(): EthQuery {
212
212
const txs : any = [
213
213
{
214
214
blockHash : '1337' ,
215
- gasUsed : '0x5208' ,
215
+ gasUsed : MINIMUM_GAS_LIMIT ,
216
216
hash : '1337' ,
217
217
status : '0x1' ,
218
218
transactionIndex : 1337 ,
@@ -1345,7 +1345,7 @@ describe('TransactionController', () => {
1345
1345
const { transactionMeta } = await controller . addTransaction (
1346
1346
{
1347
1347
from : ACCOUNT_MOCK ,
1348
- gas : '0x0' ,
1348
+ gas : MINIMUM_GAS_LIMIT ,
1349
1349
gasPrice : '0x50fd51da' ,
1350
1350
to : ACCOUNT_MOCK ,
1351
1351
value : '0x0' ,
@@ -1630,7 +1630,7 @@ describe('TransactionController', () => {
1630
1630
async ( gasPropName : keyof DappSuggestedGasFees ) => {
1631
1631
const { controller } = setupController ( ) ;
1632
1632
const mockDappOrigin = 'MockDappOrigin' ;
1633
- const mockGasValue = '0x1' ;
1633
+ const mockGasValue = MINIMUM_GAS_LIMIT ;
1634
1634
await controller . addTransaction (
1635
1635
{
1636
1636
from : ACCOUNT_MOCK ,
@@ -1736,7 +1736,7 @@ describe('TransactionController', () => {
1736
1736
const { result : firstResult } = await controller . addTransaction (
1737
1737
{
1738
1738
from : ACCOUNT_MOCK ,
1739
- gas : '0x0' ,
1739
+ gas : MINIMUM_GAS_LIMIT ,
1740
1740
gasPrice : '0x50fd51da' ,
1741
1741
to : ACCOUNT_MOCK ,
1742
1742
value : '0x0' ,
@@ -1759,7 +1759,7 @@ describe('TransactionController', () => {
1759
1759
const { result : secondResult } = await controller . addTransaction (
1760
1760
{
1761
1761
from : ACCOUNT_MOCK ,
1762
- gas : '0x2' ,
1762
+ gas : MINIMUM_GAS_LIMIT ,
1763
1763
gasPrice : '0x50fd51da' ,
1764
1764
to : ACCOUNT_MOCK ,
1765
1765
value : '0x1290' ,
@@ -2027,7 +2027,7 @@ describe('TransactionController', () => {
2027
2027
const { result } = await controller . addTransaction (
2028
2028
{
2029
2029
from : ACCOUNT_MOCK ,
2030
- gas : '0x0' ,
2030
+ gas : MINIMUM_GAS_LIMIT ,
2031
2031
gasPrice : '0x0' ,
2032
2032
to : ACCOUNT_MOCK ,
2033
2033
value : '0x0' ,
@@ -2239,7 +2239,7 @@ describe('TransactionController', () => {
2239
2239
const { result } = await controller . addTransaction (
2240
2240
{
2241
2241
from : ACCOUNT_MOCK ,
2242
- gas : '0x0' ,
2242
+ gas : MINIMUM_GAS_LIMIT ,
2243
2243
gasPrice : '0x0' ,
2244
2244
to : ACCOUNT_MOCK ,
2245
2245
value : '0x0' ,
@@ -2265,7 +2265,7 @@ describe('TransactionController', () => {
2265
2265
const { result } = await controller . addTransaction (
2266
2266
{
2267
2267
from : ACCOUNT_MOCK ,
2268
- gas : '0x0' ,
2268
+ gas : MINIMUM_GAS_LIMIT ,
2269
2269
gasPrice : '0x0' ,
2270
2270
to : ACCOUNT_MOCK ,
2271
2271
value : '0x0' ,
@@ -2285,7 +2285,7 @@ describe('TransactionController', () => {
2285
2285
const { result } = await controller . addTransaction (
2286
2286
{
2287
2287
from : ACCOUNT_MOCK ,
2288
- gas : '0x0' ,
2288
+ gas : MINIMUM_GAS_LIMIT ,
2289
2289
gasPrice : '0x0' ,
2290
2290
to : ACCOUNT_MOCK ,
2291
2291
value : '0x0' ,
@@ -2894,7 +2894,7 @@ describe('TransactionController', () => {
2894
2894
const { transactionMeta } = await controller . addTransaction (
2895
2895
{
2896
2896
from : ACCOUNT_MOCK ,
2897
- gas : '0x0' ,
2897
+ gas : MINIMUM_GAS_LIMIT ,
2898
2898
gasPrice : '0x1' ,
2899
2899
to : ACCOUNT_MOCK ,
2900
2900
value : '0x0' ,
@@ -2955,7 +2955,7 @@ describe('TransactionController', () => {
2955
2955
const { result } = await controller . addTransaction (
2956
2956
{
2957
2957
from : ACCOUNT_MOCK ,
2958
- gas : '0xFF' ,
2958
+ gas : MINIMUM_GAS_LIMIT ,
2959
2959
gasPrice : '0xEE' ,
2960
2960
to : ACCOUNT_MOCK ,
2961
2961
value : '0x0' ,
@@ -2983,8 +2983,8 @@ describe('TransactionController', () => {
2983
2983
time : expect . any ( Number ) ,
2984
2984
transaction : {
2985
2985
from : ACCOUNT_MOCK ,
2986
- gas : '0xFF' ,
2987
- gasLimit : '0xFF' ,
2986
+ gas : MINIMUM_GAS_LIMIT ,
2987
+ gasLimit : MINIMUM_GAS_LIMIT ,
2988
2988
gasPrice : '0x105' ,
2989
2989
nonce : '0xc' ,
2990
2990
to : ACCOUNT_MOCK ,
@@ -3010,7 +3010,7 @@ describe('TransactionController', () => {
3010
3010
const { transactionMeta } = await controller . addTransaction (
3011
3011
{
3012
3012
from : ACCOUNT_MOCK ,
3013
- gas : '0x0' ,
3013
+ gas : MINIMUM_GAS_LIMIT ,
3014
3014
gasPrice : '0x50fd51da' ,
3015
3015
to : ACCOUNT_MOCK ,
3016
3016
value : '0x0' ,
@@ -3143,7 +3143,7 @@ describe('TransactionController', () => {
3143
3143
const { transactionMeta } = await controller . addTransaction (
3144
3144
{
3145
3145
from : ACCOUNT_MOCK ,
3146
- gas : '0x0' ,
3146
+ gas : MINIMUM_GAS_LIMIT ,
3147
3147
gasPrice : '0x50fd51da' ,
3148
3148
to : ACCOUNT_MOCK ,
3149
3149
value : '0x0' ,
@@ -3179,7 +3179,7 @@ describe('TransactionController', () => {
3179
3179
const { transactionMeta } = await controller . addTransaction (
3180
3180
{
3181
3181
from : ACCOUNT_MOCK ,
3182
- gas : '0x0' ,
3182
+ gas : MINIMUM_GAS_LIMIT ,
3183
3183
gasPrice : '0x50fd51da' ,
3184
3184
to : ACCOUNT_MOCK ,
3185
3185
value : '0x0' ,
@@ -3220,7 +3220,7 @@ describe('TransactionController', () => {
3220
3220
const { transactionMeta } = await controller . addTransaction (
3221
3221
{
3222
3222
from : ACCOUNT_MOCK ,
3223
- gas : '0x0' ,
3223
+ gas : MINIMUM_GAS_LIMIT ,
3224
3224
gasPrice : '0x50fd51da' ,
3225
3225
to : ACCOUNT_MOCK ,
3226
3226
value : '0x0' ,
@@ -3251,7 +3251,7 @@ describe('TransactionController', () => {
3251
3251
const { transactionMeta } = await controller . addTransaction (
3252
3252
{
3253
3253
from : ACCOUNT_MOCK ,
3254
- gas : '0x0' ,
3254
+ gas : MINIMUM_GAS_LIMIT ,
3255
3255
gasPrice : '0x50fd51da' ,
3256
3256
to : ACCOUNT_MOCK ,
3257
3257
value : '0x0' ,
@@ -3282,7 +3282,7 @@ describe('TransactionController', () => {
3282
3282
const { transactionMeta, result } = await controller . addTransaction (
3283
3283
{
3284
3284
from : ACCOUNT_MOCK ,
3285
- gas : '0x1' ,
3285
+ gas : MINIMUM_GAS_LIMIT ,
3286
3286
gasPrice : '0x50fd51da' ,
3287
3287
to : ACCOUNT_MOCK ,
3288
3288
value : '0x0' ,
@@ -3305,7 +3305,7 @@ describe('TransactionController', () => {
3305
3305
transactions [ 1 ] . txParams . nonce ,
3306
3306
) ;
3307
3307
expect ( transactions [ 1 ] . estimatedBaseFee ) . toBe ( '0x123' ) ;
3308
- expect ( transactions [ 1 ] . originalGasEstimate ) . toBe ( '0x1' ) ;
3308
+ expect ( transactions [ 1 ] . originalGasEstimate ) . toBe ( MINIMUM_GAS_LIMIT ) ;
3309
3309
} ) ;
3310
3310
3311
3311
it ( 'allows transaction count to exceed txHistorylimit' , async ( ) => {
@@ -3324,7 +3324,7 @@ describe('TransactionController', () => {
3324
3324
{
3325
3325
from : ACCOUNT_MOCK ,
3326
3326
nonce : '1111111' ,
3327
- gas : '0x0' ,
3327
+ gas : MINIMUM_GAS_LIMIT ,
3328
3328
gasPrice : '0x50fd51da' ,
3329
3329
to : ACCOUNT_MOCK ,
3330
3330
value : '0x0' ,
@@ -3364,7 +3364,7 @@ describe('TransactionController', () => {
3364
3364
await controller . addTransaction (
3365
3365
{
3366
3366
from : ACCOUNT_MOCK ,
3367
- gas : '0x0' ,
3367
+ gas : MINIMUM_GAS_LIMIT ,
3368
3368
gasPrice : '0x1' ,
3369
3369
to : ACCOUNT_MOCK ,
3370
3370
value : '0x0' ,
@@ -3414,7 +3414,7 @@ describe('TransactionController', () => {
3414
3414
const { result } = await controller . addTransaction (
3415
3415
{
3416
3416
from : ACCOUNT_MOCK ,
3417
- gas : '0xFF' ,
3417
+ gas : MINIMUM_GAS_LIMIT ,
3418
3418
gasPrice : '0xEE' ,
3419
3419
to : ACCOUNT_MOCK ,
3420
3420
value : '0x0' ,
@@ -3442,8 +3442,8 @@ describe('TransactionController', () => {
3442
3442
time : expect . any ( Number ) ,
3443
3443
transaction : {
3444
3444
from : ACCOUNT_MOCK ,
3445
- gas : '0xFF' ,
3446
- gasLimit : '0xFF' ,
3445
+ gas : MINIMUM_GAS_LIMIT ,
3446
+ gasLimit : MINIMUM_GAS_LIMIT ,
3447
3447
gasPrice : '0x105' ,
3448
3448
nonce : '0xc' ,
3449
3449
to : ACCOUNT_MOCK ,
@@ -3474,7 +3474,7 @@ describe('TransactionController', () => {
3474
3474
} ,
3475
3475
} ;
3476
3476
const externalTransactionReceipt = {
3477
- gasUsed : '0x5208' ,
3477
+ gasUsed : MINIMUM_GAS_LIMIT ,
3478
3478
} ;
3479
3479
const externalBaseFeePerGas = '0x14' ;
3480
3480
@@ -3514,7 +3514,7 @@ describe('TransactionController', () => {
3514
3514
} ;
3515
3515
3516
3516
const externalTransactionReceipt = {
3517
- gasUsed : '0x5208' ,
3517
+ gasUsed : MINIMUM_GAS_LIMIT ,
3518
3518
} ;
3519
3519
3520
3520
const externalBaseFeePerGas = '0x14' ;
@@ -3590,7 +3590,7 @@ describe('TransactionController', () => {
3590
3590
} ,
3591
3591
} ;
3592
3592
const externalTransactionReceipt = {
3593
- gasUsed : '0x5208' ,
3593
+ gasUsed : MINIMUM_GAS_LIMIT ,
3594
3594
} ;
3595
3595
const externalBaseFeePerGas = '0x14' ;
3596
3596
@@ -3683,7 +3683,7 @@ describe('TransactionController', () => {
3683
3683
} ,
3684
3684
} ;
3685
3685
const externalTransactionReceipt = {
3686
- gasUsed : '0x5208' ,
3686
+ gasUsed : MINIMUM_GAS_LIMIT ,
3687
3687
} ;
3688
3688
const externalBaseFeePerGas = '0x14' ;
3689
3689
@@ -3774,7 +3774,7 @@ describe('TransactionController', () => {
3774
3774
} as any ;
3775
3775
3776
3776
const externalTransactionReceipt = {
3777
- gasUsed : '0x5208' ,
3777
+ gasUsed : MINIMUM_GAS_LIMIT ,
3778
3778
} ;
3779
3779
const externalBaseFeePerGas = '0x14' ;
3780
3780
@@ -3824,7 +3824,7 @@ describe('TransactionController', () => {
3824
3824
// eslint-disable-next-line @typescript-eslint/no-explicit-any
3825
3825
} as any ;
3826
3826
const externalTransactionReceipt = {
3827
- gasUsed : '0x5208' ,
3827
+ gasUsed : MINIMUM_GAS_LIMIT ,
3828
3828
} ;
3829
3829
const externalBaseFeePerGas = '0x14' ;
3830
3830
@@ -4254,8 +4254,8 @@ describe('TransactionController', () => {
4254
4254
updateToInitialState : true ,
4255
4255
} ) ;
4256
4256
4257
- const gas = '0x1' ;
4258
- const gasLimit = '0x2 ' ;
4257
+ const gas = MINIMUM_GAS_LIMIT ;
4258
+ const gasLimit = '0x5209 ' ;
4259
4259
const gasPrice = '0x12' ;
4260
4260
const estimateUsed = '0x3' ;
4261
4261
const estimateSuggested = '0x123' ;
@@ -4708,7 +4708,7 @@ describe('TransactionController', () => {
4708
4708
const mockTransactionParam = {
4709
4709
from : ACCOUNT_MOCK ,
4710
4710
nonce : '0x1' ,
4711
- gas : '0x5208' ,
4711
+ gas : MINIMUM_GAS_LIMIT ,
4712
4712
to : ACCOUNT_2_MOCK ,
4713
4713
value : '0x0' ,
4714
4714
chainId : MOCK_NETWORK . chainId ,
@@ -5760,7 +5760,7 @@ describe('TransactionController', () => {
5760
5760
const params = {
5761
5761
data : '0x12' ,
5762
5762
from : ACCOUNT_2_MOCK ,
5763
- gas : '0x0' ,
5763
+ gas : MINIMUM_GAS_LIMIT ,
5764
5764
gasPrice : '0x50fd51da' ,
5765
5765
to : ACCOUNT_MOCK ,
5766
5766
value : '0x0' ,
0 commit comments