Skip to content

Commit

Permalink
chore: update to testnet (#1310)
Browse files Browse the repository at this point in the history
  • Loading branch information
LuizAsFight committed May 20, 2024
1 parent dfd945c commit 00df270
Show file tree
Hide file tree
Showing 12 changed files with 24 additions and 19 deletions.
5 changes: 5 additions & 0 deletions .changeset/many-feet-leave.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"fuels-wallet": minor
---

Auto-update network to testnet (Ignition)
4 changes: 2 additions & 2 deletions packages/app/.env.production
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
VITE_CRX_NAME="Fuel Wallet"
VITE_CRX_VERSION_API="https://fuellabs.github.io/fuels-wallet/latest.json"
VITE_CRX_RELEASE=true
VITE_FUEL_PROVIDER_URL=https://devnet.fuel.network/v1/graphql
VITE_FUEL_FAUCET_URL=https://faucet-devnet.fuel.network/
VITE_FUEL_PROVIDER_URL=https://testnet.fuel.network/v1/graphql
VITE_FUEL_FAUCET_URL=https://faucet-testnet.fuel.network/
VITE_EXPLORER_URL=https://app.fuel.network/
VITE_MNEMONIC_WORDS=12
VITE_AUTO_LOCK_IN_MINUTES=10
Expand Down
2 changes: 1 addition & 1 deletion packages/app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "fuels-wallet",
"private": true,
"version": "0.18.1",
"database": "15",
"database": "16",
"scripts": {
"build:all": "run-s build:web build:crx build:storybook",
"build:web": "./scripts/build.sh --app=vite",
Expand Down
4 changes: 2 additions & 2 deletions packages/app/playwright/crx/crx.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -568,7 +568,7 @@ test.describe('FuelWallet Extension', () => {

// Check if added network is selected
let networkSelector = getByAriaLabel(popupPage, 'Selected Network');
await expect(networkSelector).toHaveText(/Ignition\-Dev/);
await expect(networkSelector).toHaveText(/Ignition/);

// Remove added network
await networkSelector.click();
Expand All @@ -594,7 +594,7 @@ test.describe('FuelWallet Extension', () => {

// Check if re-added network is selected
networkSelector = getByAriaLabel(popupPage, 'Selected Network');
await expect(networkSelector).toHaveText(/Ignition\-Dev/);
await expect(networkSelector).toHaveText(/Ignition/);
});

await test.step('window.fuel.on("currentAccount") to a connected account', async () => {
Expand Down
6 changes: 3 additions & 3 deletions packages/app/playwright/e2e/Networks.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,13 +88,13 @@ test.describe('Networks', () => {
await expect(buttonCreate).toBeDisabled();
const urlInput = getInputByName(page, 'url');
await expect(urlInput).toBeFocused();
await urlInput.fill('https://devnet.fuel.network/v1/graphql');
await hasText(page, /Ignition\-Dev/i, 0, 15000);
await urlInput.fill('https://testnet.fuel.network/v1/graphql');
await hasText(page, /Ignition/i, 0, 15000);
await expect(buttonCreate).toBeEnabled();
await buttonCreate.click();
// Wait for save and close popup;
await page.waitForTimeout(2000);
await reload(page);
await hasText(page, /Ignition\-Dev/i);
await hasText(page, /Ignition/i);
});
});
2 changes: 1 addition & 1 deletion packages/app/playwright/mocks/database.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ export const ALT_ASSET = {
};

export const FUEL_NETWORK = {
url: 'https://devnet.fuel.network/v1/graphql',
url: 'https://testnet.fuel.network/v1/graphql',
};

export async function getAccount(page: Page) {
Expand Down
2 changes: 1 addition & 1 deletion packages/app/src/systems/Asset/__mocks__/assets.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { uniqueId } from 'xstate/lib/utils';
export const MOCK_NETWORK = {
id: uniqueId(),
name: 'Another',
url: 'https://devnet.fuel.network/v1/graphql',
url: 'https://testnet.fuel.network/v1/graphql',
};

export const MOCK_FUEL_ASSETS = assets.map((asset) => {
Expand Down
2 changes: 1 addition & 1 deletion packages/app/src/systems/Core/utils/database.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ export class FuelDB extends Dexie {
await networks.clear();
// Insert beta-5 network
await networks.add({
name: 'Ignition-Dev',
name: 'Ignition',
url: VITE_FUEL_PROVIDER_URL,
isSelected: true,
id: createUUID(),
Expand Down
2 changes: 1 addition & 1 deletion packages/app/src/systems/Network/__mocks__/networks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ export const MOCK_NETWORKS = [
{
id: uniqueId(),
name: 'Another',
url: 'https://devnet.fuel.network/v1/graphql',
url: 'https://testnet.fuel.network/v1/graphql',
},
];
2 changes: 1 addition & 1 deletion packages/app/src/systems/Network/utils/url.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { isValidNetworkUrl } from './url';
describe('isValidNetworkUrl()', () => {
it('should return true for valid network urls', () => {
expect(isValidNetworkUrl('http://localhost:4000/graphql')).toBe(true);
expect(isValidNetworkUrl('https://devnet.fuel.network/v1/graphql')).toBe(
expect(isValidNetworkUrl('https://testnet.fuel.network/v1/graphql')).toBe(
true
);
expect(isValidNetworkUrl('https://beta-5.fuel.network/graphql')).toBe(true);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,21 +10,21 @@ export interface ActivityListProps {
txs: TransactionSummary[];
providerUrl?: string;
isLoading?: boolean;
isDevnet?: boolean;
isTestnet?: boolean;
ownerAddress: string;
}

export const ActivityList = ({
txs,
isDevnet = false,
isTestnet = false,
isLoading,
ownerAddress,
}: ActivityListProps) => {
if (isLoading) return <ActivityList.Loading />;

const isEmpty = !txs?.length;

if (isEmpty) return <ActivityList.Empty isDevnet={isDevnet} />;
if (isEmpty) return <ActivityList.Empty isTestnet={isTestnet} />;

return (
<Box.Stack gap="$2">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ import { ImageLoader, relativeUrl } from '~/systems/Core';
import { useOpenFaucet } from '~/systems/Faucet';

type ActivityEmptyProps = {
isDevnet?: boolean;
isTestnet?: boolean;
bridgeUrl?: string;
};

export function ActivityListEmpty({ isDevnet }: ActivityEmptyProps) {
export function ActivityListEmpty({ isTestnet }: ActivityEmptyProps) {
const openFaucet = useOpenFaucet();
const { current: theme } = useFuelTheme();
return (
Expand All @@ -24,7 +24,7 @@ export function ActivityListEmpty({ isDevnet }: ActivityEmptyProps) {
<Text fontSize="sm">
When you make a transaction you&apos;ll see it here
</Text>
{isDevnet && (
{isTestnet && (
/**
* TODO: need to add right faucet icon on @fuel-ui
*/
Expand Down

0 comments on commit 00df270

Please sign in to comment.