Skip to content

Commit 0669161

Browse files
committed
chore: revert burner wallet to keep using testnet
1 parent 4660bb7 commit 0669161

File tree

3 files changed

+17
-19
lines changed

3 files changed

+17
-19
lines changed

packages/burner-wallet-connector/src/BurnerWalletConnector.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ export class BurnerWalletConnector extends FuelConnector {
5959
}
6060

6161
private configProvider(config: BurnerWalletConfig = {}) {
62-
const network = getProviderUrl(config.chainId ?? CHAIN_IDS.fuel.mainnet);
62+
const network = getProviderUrl(config.chainId ?? CHAIN_IDS.fuel.testnet);
6363
this.config = Object.assign(config, {
6464
fuelProvider: config.fuelProvider || Provider.create(network),
6565
});

packages/burner-wallet-connector/src/tests/burnerWalletConnector.test.ts

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import path from 'node:path';
2-
import { MAINNET_NETWORK } from '@fuel-connectors/common';
2+
import { TESTNET_NETWORK } from '@fuel-connectors/common';
33
import { type Asset, type Network, Provider, Wallet } from 'fuels';
44
import { launchTestNode } from 'fuels/test-utils';
55
import {
@@ -17,8 +17,6 @@ import { BURNER_WALLET_PRIVATE_KEY } from '../constants';
1717
import type { BurnerWalletConfig } from '../types';
1818
import { createMockedStorage } from './mockedStorage';
1919

20-
const TESTNET_URL = 'https://testnet.fuel.network/v1/graphql';
21-
2220
const mockConfirm = vi.fn();
2321
window.confirm = mockConfirm;
2422

@@ -74,7 +72,7 @@ describe('Burner Wallet Connector', () => {
7472
expect(connector.connected).to.be.false;
7573
expect(connector.installed).to.be.true;
7674
expect(await connector.currentNetwork()).to.be.deep.equal(
77-
MAINNET_NETWORK,
75+
TESTNET_NETWORK,
7876
);
7977
});
8078

@@ -149,33 +147,31 @@ describe('Burner Wallet Connector', () => {
149147
});
150148

151149
test('Creates a new BurnerWalletConnector instance with non default Provider url', async () => {
152-
const nonDefaultProvider = await Provider.create(TESTNET_URL);
150+
const nonDefaultProvider = await Provider.create(TESTNET_NETWORK.url);
153151

154152
const config: BurnerWalletConfig = {
155153
fuelProvider: nonDefaultProvider,
156154
};
157155
const connector = await getBurnerWallet(config);
158156

159157
expect(connector).to.be.an.instanceOf(BurnerWalletConnector);
160-
expect(await connector.currentNetwork()).to.be.deep.equal({
161-
chainId: 0,
162-
url: TESTNET_URL,
163-
});
158+
expect(await connector.currentNetwork()).to.be.deep.equal(
159+
TESTNET_NETWORK,
160+
);
164161
});
165162

166163
test('Creates a new BurnerWalletConnector instance with non default Promise Provider url', async () => {
167-
const nonDefaultProvider = Provider.create(TESTNET_URL);
164+
const nonDefaultProvider = Provider.create(TESTNET_NETWORK.url);
168165

169166
const config: BurnerWalletConfig = {
170167
fuelProvider: nonDefaultProvider,
171168
};
172169

173170
const connector = await getBurnerWallet(config);
174171
expect(connector).to.be.an.instanceOf(BurnerWalletConnector);
175-
expect(await connector.currentNetwork()).to.be.deep.equal({
176-
chainId: 0,
177-
url: TESTNET_URL,
178-
});
172+
expect(await connector.currentNetwork()).to.be.deep.equal(
173+
TESTNET_NETWORK,
174+
);
179175
});
180176
});
181177

packages/common/src/networks.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,17 @@
11
import { CHAIN_IDS, type Network } from 'fuels';
22

3+
export const TESTNET_NETWORK: Network = {
4+
chainId: CHAIN_IDS.fuel.testnet,
5+
url: 'https://testnet.fuel.network/v1/graphql',
6+
};
7+
38
export const MAINNET_NETWORK: Network = {
49
chainId: CHAIN_IDS.fuel.mainnet,
510
url: 'https://mainnet.fuel.network/v1/graphql',
611
};
712

813
export const DEFAULT_NETWORKS: Network[] = [
9-
{
10-
chainId: CHAIN_IDS.fuel.testnet,
11-
url: 'https://testnet.fuel.network/v1/graphql',
12-
},
14+
TESTNET_NETWORK,
1315
{
1416
chainId: CHAIN_IDS.fuel.devnet,
1517
url: 'https://devnet.fuel.network/v1/graphql',

0 commit comments

Comments
 (0)