Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/ComposableController.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ describe('ComposableController', () => {
},
NetworkController: {
network: 'loading',
properties: { isEIP1559Compatible: false },
provider: { type: 'mainnet', chainId: NetworksChainId.mainnet },
},
PreferencesController: {
Expand Down Expand Up @@ -188,6 +189,7 @@ describe('ComposableController', () => {
ipfsGateway: 'https://ipfs.io/ipfs/',
lostIdentities: {},
network: 'loading',
properties: { isEIP1559Compatible: false },
provider: { type: 'mainnet', chainId: NetworksChainId.mainnet },
selectedAddress: '',
suggestedAssets: [],
Expand Down
1 change: 1 addition & 0 deletions src/network/NetworkController.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ describe('NetworkController', () => {
const controller = new NetworkController();
expect(controller.state).toStrictEqual({
network: 'loading',
properties: { isEIP1559Compatible: false },
provider: {
type: 'mainnet',
chainId: '1',
Expand Down
3 changes: 3 additions & 0 deletions src/network/NetworkController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -304,6 +304,9 @@ export class NetworkController extends BaseController<
const { properties = {} } = this.state;

if (!properties.isEIP1559Compatible) {
if (!this.ethQuery || !this.ethQuery.sendAsync) {
return Promise.resolve(true);
}
return new Promise((resolve, reject) => {
this.ethQuery.sendAsync(
{ method: 'eth_getBlockByNumber', params: ['latest', false] },
Expand Down
3 changes: 3 additions & 0 deletions src/transaction/TransactionController.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ const MOCK_NETWORK = {
getProvider: () => PROVIDER,
state: {
network: '3',
properties: { isEIP1559Compatible: false },
provider: {
type: 'ropsten' as NetworkType,
chainId: NetworksChainId.ropsten,
Expand All @@ -98,6 +99,7 @@ const MOCK_MAINNET_NETWORK = {
getProvider: () => MAINNET_PROVIDER,
state: {
network: '1',
properties: { isEIP1559Compatible: false },
provider: {
type: 'mainnet' as NetworkType,
chainId: NetworksChainId.mainnet,
Expand All @@ -109,6 +111,7 @@ const MOCK_CUSTOM_NETWORK = {
getProvider: () => MAINNET_PROVIDER,
state: {
network: '80001',
properties: { isEIP1559Compatible: false },
provider: {
type: 'rpc' as NetworkType,
chainId: '80001',
Expand Down