Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: bumped fuels version to 0.98.0 #1766

Closed
wants to merge 6 commits into from
Closed
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
8 changes: 8 additions & 0 deletions .changeset/tasty-yaks-prove.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
"@fuels/playwright-utils": patch
"@fuel-wallet/connections": patch
"@fuel-wallet/types": patch
"fuels-wallet": patch
---

chore: upgraded versions
2 changes: 1 addition & 1 deletion .github/actions/setup-rust/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: 'Forc Setup'

inputs:
forc-components:
default: 'forc@0.65.2, fuel-core@0.39.0'
default: 'forc@0.66.5, fuel-core@0.40.2'

runs:
using: 'composite'
Expand Down
4 changes: 2 additions & 2 deletions Forc.lock
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[[package]]
name = "core"
source = "path+from-root-8357A6DDC5F39D14"
source = "path+from-root-6A8836696D55BC6E"

[[package]]
name = "custom_asset"
Expand All @@ -23,7 +23,7 @@ dependencies = ["std"]

[[package]]
name = "std"
source = "git+https://github.com/fuellabs/sway?tag=v0.65.2#66bb430395daf5b8f7205f7b9d8d008e2e812d54"
source = "git+https://github.com/fuellabs/sway?tag=v0.66.5#94a066652468b4afa3bd396dacef482ed590976b"
dependencies = ["core"]

[[package]]
Expand Down
2 changes: 1 addition & 1 deletion examples/cra-dapp/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"@fuels/connectors": "0.35.1",
"@fuels/react": "0.35.1",
"@tanstack/react-query": "5.28.4",
"fuels": "0.96.1",
"fuels": "0.98.0",
"react": "18.3.1",
"react-dom": "18.3.1"
},
Expand Down
4 changes: 2 additions & 2 deletions fuel-toolchain.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
channel = "testnet"

[components]
fuel-core = "0.38.0"
forc = "0.65.2"
fuel-core = "0.40.2"
forc = "0.66.5"
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@
"send@<0.19.0": ">=0.19.0",
"serve-static@<1.16.0": ">=1.16.0",
"rollup@>=4.0.0 <4.22.4": ">=4.22.4",
"fuels": "0.96.1",
"fuels": "0.98.0",
"secp256k1@=5.0.0": ">=5.0.1",
"elliptic@<6.6.0": ">=6.6.0",
"cross-spawn@<7.0.5": ">=7.0.5",
Expand Down
2 changes: 1 addition & 1 deletion packages/app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
"events": "3.3.0",
"fake-indexeddb": "4.0.2",
"framer-motion": "10.16.4",
"fuels": "0.96.1",
"fuels": "0.98.0",
"json-edit-react": "1.13.3",
"json-rpc-2.0": "1.7.0",
"lodash.debounce": "4.0.8",
Expand Down
4 changes: 2 additions & 2 deletions packages/app/playwright/commons/seedWallet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@ export async function seedCurrentAccount(page: Page, amount: BN) {
}

export async function seedWallet(address: string, amount: BN) {
const provider = await Provider.create(VITE_FUEL_PROVIDER_URL);
const provider = new Provider(VITE_FUEL_PROVIDER_URL);
const genesisWallet = Wallet.fromPrivateKey(GENESIS_SECRET, provider);

const transfETH = await genesisWallet.transfer(
Address.fromString(address),
amount,
provider.getBaseAssetId()
await provider.getBaseAssetId()
);
await transfETH.wait();

Expand Down
2 changes: 1 addition & 1 deletion packages/app/playwright/crx/crx.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ test.describe('FuelWallet Extension', () => {
});

test('SDK operations', async ({ context, baseURL, extensionId }) => {
const provider = await Provider.create(process.env.VITE_FUEL_PROVIDER_URL);
const provider = new Provider(process.env.VITE_FUEL_PROVIDER_URL);
// Use a single instance of the page to avoid
// multiple waiting times, and window.fuel checking.
const blankPage = await context.newPage();
Expand Down
8 changes: 4 additions & 4 deletions packages/app/playwright/e2e/Accounts.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -184,15 +184,15 @@ test.describe('Existing Accounts', () => {
test('can add accounts using correct derivation path after importing from private key', async () => {
// at this point 2 accounts have already been created
const fuelAddress1 =
'fuel1kfnz04g7k8wjw22s03s3kk46wxr63he3v5v6kyrv76m7wzh7x9jqvqffua';
'0xb26627d51eb1dd2729507c611b5aba7187a8df316519ab106cf6b7e70afe3164';
const fuelAddress2 =
'fuel1kyxzyv5z39fuxnr6k9ncxujxn4y07fu6pf73vslmemgpex325vrsytpqks';
'0xb10c2232828953c34c7ab1678372469d48ff279a0a7d1643fbced01c9a2aa307';
const fuelAddress3 =
'fuel152720qgc5wthxu4g7a2g6s7xy9d8wjgtffl489k706xyd2fas0wqyv0vsw';
'0xa2bca78118a3977372a8f7548d43c6215a77490b4a7f5396de7e8c46a93d83dc';
const fuelPrivKey =
'0x7f802a2a277872af1204140bd2c77c2193309c366e3c71ff1c4c31cea0a53f38';
const fuelAddPriv =
'fuel1szu0uagadwpgl0fuz2thrtzn7artghvhexg5d9at4t76nzeesqasrdmjxy';
'0x80b8fe751d6b828fbd3c129771ac53f746b45d97c9914697abaafda98b39803b';

// import account from private key
await createAccountFromPrivateKey(page, fuelPrivKey, 'Account 3');
Expand Down
4 changes: 2 additions & 2 deletions packages/app/playwright/e2e/SendTransaction.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ test.describe('SendTransaction', () => {
const { accounts } = await mockData(page);
account = accounts[0];
await seedWallet(account.address, bn(100_000_000));
provider = await Provider.create(process.env.VITE_FUEL_PROVIDER_URL);
provider = new Provider(process.env.VITE_FUEL_PROVIDER_URL);
});

test('Send transaction', async () => {
Expand Down Expand Up @@ -358,7 +358,7 @@ test.describe('SendTransaction', () => {
});

test('Send transaction to an asset address should fail', async () => {
const assetAddress = provider.getBaseAssetId();
const assetAddress = await provider.getBaseAssetId();
await visit(page, '/send');
await getInputByName(page, 'address').fill(assetAddress);
await getInputByName(page, 'amount').fill('0.001');
Expand Down
3 changes: 2 additions & 1 deletion packages/app/src/systems/Account/__mocks__/accounts.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ export const MOCK_ACCOUNTS = [
},
{
name: 'Account 4',
address: 'fuel10va6297tkerdcn5u8mxjm9emudsmkj85pq5x7t7stkmzmc4nvs3qvn99qz',
address:
'0x7b3ba517cbb646dc4e9c3ecd2d973be361bb48f408286f2fd05db62de2b36422',
publicKey: '0x00',
},
];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ import { FuelAddress } from './FuelAddress';

const accountAddressB256 =
'0x2230bd556418ddc58b48065208b3958a8db247f11394023e17ff143db7235c6c';
const accountAddressBech32 =
'fuel1ygct64tyrrwutz6gqefq3vu432xmy3l3zw2qy0shlu2rmdert3kqx97pfj';

describe('FuelAddress', () => {
it('a11y', async () => {
Expand All @@ -19,9 +17,4 @@ describe('FuelAddress', () => {
renderWithProvider(<FuelAddress address={accountAddressB256} />);
expect(screen.getByText('0x2230...5C6C')).toBeInTheDocument();
});

it('should show b256 address from bech32', () => {
renderWithProvider(<FuelAddress address={accountAddressBech32} />);
expect(screen.getByText('0x2230...5C6C')).toBeInTheDocument();
});
});
Original file line number Diff line number Diff line change
@@ -1,18 +1,13 @@
import type { ThemeUtilsCSS } from '@fuel-ui/css';
import { cssObj } from '@fuel-ui/css';
import { Box, Copyable, Icon, IconButton, Text } from '@fuel-ui/react';
import {
Address,
type B256Address,
type Bech32Address,
type ChecksumAddress,
} from 'fuels';
import { Address, type B256Address, type ChecksumAddress } from 'fuels';
import { useMemo } from 'react';
import { shortAddress } from '~/systems/Core';
import { useExplorerLink } from '../../hooks/useExplorerLink';

export type AddressProps = {
address: ChecksumAddress | Bech32Address | B256Address;
address: ChecksumAddress | B256Address;
canOpenExplorer?: boolean;
css?: ThemeUtilsCSS;
isContract?: boolean;
Expand Down
6 changes: 3 additions & 3 deletions packages/app/src/systems/Account/services/account.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ import { AssetsCache } from '~/systems/Asset/cache/AssetsCache';
import { chromeStorage } from '~/systems/Core/services/chromeStorage';
import type { Maybe } from '~/systems/Core/types';
import { db } from '~/systems/Core/utils/database';
import { readFromOPFS } from '~/systems/Core/utils/opfs';
import { getUniqueString } from '~/systems/Core/utils/string';
import { getTestNoDexieDbData } from '../utils/getTestNoDexieDbData';
import { readFromOPFS } from '~/systems/Core/utils/opfs';

export type AccountInputs = {
addAccount: {
Expand Down Expand Up @@ -108,7 +108,7 @@ export class AccountService {
const provider = await createProvider(providerUrl!);
const balances = await getBalances(provider, account.publicKey);
const balanceAssets = await AssetsCache.fetchAllAssets(
provider.getChainId(),
await provider.getChainId(),
balances.map((balance) => balance.assetId)
);
// includes "asset" prop in balance, centralizing the complexity here instead of in rest of UI
Expand Down Expand Up @@ -142,7 +142,7 @@ export class AccountService {
});

// includes eth balance info, centralizing the complexity here instead of in rest of UI
const baseAssetId = provider.getBaseAssetId();
const baseAssetId = await provider.getBaseAssetId();
const ethAsset = balances.find(
(balance) => balance.assetId === baseAssetId.toString()
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -314,12 +314,10 @@ export class BackgroundService {
this.communicationProtocol
);

// We need to forward bech32 addresses to the popup, regardless if we receive a b256 here
// our database is storing fuel addresses
const bech32Address = Address.fromDynamicInput(address).toString();
const b256Address = Address.fromDynamicInput(address).toString();

const signedMessage = await popupService.sendTransaction({
address: bech32Address,
address: b256Address,
Comment on lines -317 to +320
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We have removed the bech32 address.

From this comment, it appears we store bech32 in the database? Would be good to validate this.

provider,
transaction,
origin,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ import {
FuelConnectorEventTypes,
type NetworkEvent,
} from 'fuels';
import { chromeStorage } from '~/systems/Core/services/chromeStorage';
import type { CommunicationProtocol } from './CommunicationProtocol';
import { DatabaseObservable } from './DatabaseObservable';
import { chromeStorage } from '~/systems/Core/services/chromeStorage';

export class DatabaseEvents {
readonly databaseObservable: DatabaseObservable<
Expand Down Expand Up @@ -75,7 +75,7 @@ export class DatabaseEvents {
}
);

// -- START Events for sync db with chrome storage
// -- START Events for sync db with chrome storage
this.databaseObservable.on<'accounts:create', Account>(
'accounts:create',
async (event) => {
Expand All @@ -101,7 +101,7 @@ export class DatabaseEvents {
}
}
);
// -- END Events for sync db with chrome storage
// -- END Events for sync db with chrome storage

this.databaseObservable.on<'accounts:update', Account>(
'accounts:update',
Expand Down
2 changes: 1 addition & 1 deletion packages/app/src/systems/Core/services/chromeStorage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,5 +83,5 @@ export const chromeStorage = {
vaults: new ChromeStorageTable<Vault>('vaults'),
clear: () => {
chrome?.storage?.local?.clear();
}
},
};
6 changes: 4 additions & 2 deletions packages/app/src/systems/Core/utils/adress.test.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
import type { B256Address } from 'fuels';
import { shortAddress } from './address';

describe('shortAddress()', () => {
it('should show a small version of a full address', () => {
const addr = 'fuel0x2c8e117bcfba11c76d7db2d43464b1d2093474ef';
expect(shortAddress(addr)).toBe('fuel0x...74ef');
const addr: B256Address =
'0xef3b7b4c5adcb9c7f76f8d77f422f4a25eb404b2f26c21e346fd4e2e12826798';
expect(shortAddress(addr)).toBe('0xef3b...6798');
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export const getMockedTransaction = async (
const transactionRequest = await TxService.createTransfer({
to: destinyAddress.toString(),
amount: bn.parseUnits('0.1'),
assetId: provider.getBaseAssetId(),
assetId: await provider.getBaseAssetId(),
tip: bn(0),
gasLimit: bn(1_000_000),
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { TestWrapper } from '~/systems/Core/components/TestWrapper';
import { ReceiverQRCode } from './QRCode';

const TEST_ACCOUNT =
'fuel1auahknz6mjuu0am034mlggh55f0tgp9j7fkzrc6xl48zuy5zv7vqa07n30';
'0xef3b7b4c5adcb9c7f76f8d77f422f4a25eb404b2f26c21e346fd4e2e12826798';

describe('QR Code Tests', () => {
it('should show the qr code on screen', async () => {
Expand Down
Loading
Loading