1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-11-22 18:00:18 +01:00

Use TRANSACTION_ENVELOPE_TYPES for legacy transaction type testing (#12455)

This commit is contained in:
David Walsh 2021-10-27 18:55:02 -05:00 committed by GitHub
parent 6e928c661e
commit b5e601bc87
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 9 additions and 4 deletions

View File

@ -1,5 +1,6 @@
import { strict as assert } from 'assert'; import { strict as assert } from 'assert';
import { GAS_LIMITS } from '../../../../shared/constants/gas'; import { GAS_LIMITS } from '../../../../shared/constants/gas';
import { TRANSACTION_ENVELOPE_TYPES } from '../../../../shared/constants/transaction';
import { txMetaStub } from '../../../../test/stub/tx-meta-stub'; import { txMetaStub } from '../../../../test/stub/tx-meta-stub';
import { import {
createPendingNonceMiddleware, createPendingNonceMiddleware,
@ -63,7 +64,7 @@ describe('PendingNonceMiddleware', function () {
'0x2cc5a25744486f7383edebbf32003e5a66e18135799593d6b5cdd2bb43674f09', '0x2cc5a25744486f7383edebbf32003e5a66e18135799593d6b5cdd2bb43674f09',
input: '0x', input: '0x',
nonce: '0x4', nonce: '0x4',
type: '0x0', type: TRANSACTION_ENVELOPE_TYPES.LEGACY,
to: '0xf231d46dd78806e1dd93442cf33c7671f8538748', to: '0xf231d46dd78806e1dd93442cf33c7671f8538748',
transactionIndex: null, transactionIndex: null,
value: '0x0', value: '0x0',

View File

@ -2,7 +2,9 @@ import { strict as assert } from 'assert';
import { import {
TRANSACTION_STATUSES, TRANSACTION_STATUSES,
TRANSACTION_TYPES, TRANSACTION_TYPES,
TRANSACTION_ENVELOPE_TYPES,
} from '../../../../shared/constants/transaction'; } from '../../../../shared/constants/transaction';
import { formatTxMetaForRpcResult } from './util'; import { formatTxMetaForRpcResult } from './util';
describe('network utils', function () { describe('network utils', function () {
@ -92,7 +94,7 @@ describe('network utils', function () {
s: '0x18bfc4eeb7ebcfacc3bd59ea100a6834ea3265e65945dbec69aa2a06564fafff', s: '0x18bfc4eeb7ebcfacc3bd59ea100a6834ea3265e65945dbec69aa2a06564fafff',
to: '0x1678a085c290ebd122dc42cba69373b5953b831d', to: '0x1678a085c290ebd122dc42cba69373b5953b831d',
transactionIndex: null, transactionIndex: null,
type: '0x0', type: TRANSACTION_ENVELOPE_TYPES.LEGACY,
v: '0x29', v: '0x29',
value: '0x0', value: '0x0',
}; };

View File

@ -12,7 +12,9 @@ import {
import { import {
TRANSACTION_STATUSES, TRANSACTION_STATUSES,
TRANSACTION_TYPES, TRANSACTION_TYPES,
TRANSACTION_ENVELOPE_TYPES,
} from '../../../../shared/constants/transaction'; } from '../../../../shared/constants/transaction';
import { SECOND } from '../../../../shared/constants/time'; import { SECOND } from '../../../../shared/constants/time';
import { GAS_ESTIMATE_TYPES } from '../../../../shared/constants/gas'; import { GAS_ESTIMATE_TYPES } from '../../../../shared/constants/gas';
import { METAMASK_CONTROLLER_EVENTS } from '../../metamask-controller'; import { METAMASK_CONTROLLER_EVENTS } from '../../metamask-controller';
@ -544,7 +546,7 @@ describe('Transaction Controller', function () {
txParams: { txParams: {
to: VALID_ADDRESS, to: VALID_ADDRESS,
from: VALID_ADDRESS_TWO, from: VALID_ADDRESS_TWO,
type: '0x0', type: TRANSACTION_ENVELOPE_TYPES.LEGACY,
}, },
history: [{}], history: [{}],
}, },
@ -554,7 +556,7 @@ describe('Transaction Controller', function () {
txParams: { txParams: {
from: '0xc684832530fcbddae4b4230a47e991ddcec2831d', from: '0xc684832530fcbddae4b4230a47e991ddcec2831d',
to: '0xc684832530fcbddae4b4230a47e991ddcec2831d', to: '0xc684832530fcbddae4b4230a47e991ddcec2831d',
type: '0x0', type: TRANSACTION_ENVELOPE_TYPES.LEGACY,
}, },
history: [{}], history: [{}],
}; };