Skip to content

Commit

Permalink
fix: update fuels and fix build errors (#923)
Browse files Browse the repository at this point in the history
closes FRO-630

close: #927
  • Loading branch information
matt-user authored Oct 19, 2023
1 parent 0084c6c commit f683bae
Show file tree
Hide file tree
Showing 13 changed files with 408 additions and 452 deletions.
10 changes: 10 additions & 0 deletions .changeset/six-swans-wash.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
'@fuel-wallet/e2e-contract-tests': patch
'@fuel-wallet/test-utils': patch
'@fuel-wallet/react': patch
'@fuel-wallet/types': patch
'fuels-wallet': patch
'@fuel-wallet/sdk': patch
---

chore: bump fuels version
9 changes: 9 additions & 0 deletions packages/app/jest.setup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,15 @@ const noop = () => {};
Object.defineProperty(window, 'scrollTo', { value: noop, writable: true });
Object.defineProperty(window, 'localStorage', { value: localStorageMock });
Object.defineProperty(window, 'crypto', { value: webcrypto });
// This is needed bc of this error https://github.com/jestjs/jest/issues/2549
Object.defineProperty(Uint8Array, Symbol.hasInstance, {
value(potentialInstance: unknown) {
return this === Uint8Array
? Object.prototype.toString.call(potentialInstance) ===
'[object Uint8Array]'
: Uint8Array[Symbol.hasInstance].call(this, potentialInstance);
},
});

if (process.env.CI) {
// If test fails retry it until success
Expand Down
4 changes: 2 additions & 2 deletions packages/app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
},
"dependencies": {
"@fontsource/source-code-pro": "^5.0.13",
"@fuel-ts/wallet-manager": "0.58.0",
"@fuel-ts/wallet-manager": "0.63.0",
"@fuel-ui/css": "0.21.1",
"@fuel-ui/icons": "0.21.1",
"@fuel-ui/react": "0.21.1",
Expand All @@ -46,7 +46,7 @@
"events": "^3.3.0",
"fake-indexeddb": "^4.0.2",
"framer-motion": "^10.16.4",
"fuels": "0.58.0",
"fuels": "0.63.0",
"graphql": "^16.8.1",
"graphql-request": "^6.1.0",
"graphql-tag": "^2.12.6",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,7 @@ export class TxService {
abiMap,
gasPerByte,
gasPriceFactor,
maxInputs: bn(255),
});
transactionSummary.fee = await calculateTotalFee({
gasPerByte,
Expand Down
2 changes: 1 addition & 1 deletion packages/docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"acorn-walk": "^8.2.0",
"dotenv": "^16.3.1",
"framer-motion": "^10.16.4",
"fuels": "0.58.0",
"fuels": "0.63.0",
"globby": "^13.2.2",
"gray-matter": "^4.0.3",
"hast-util-heading-rank": "^3.0.0",
Expand Down
3 changes: 2 additions & 1 deletion packages/e2e-contract-tests/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"scripts": {
"dev:e2e-contracts": "vite",
"build:web": "vite build",
"ts:check": "tsc --noEmit",
"build:contracts": "pnpm exec fuels typegen -i ./contracts/custom_asset/out/debug/*-abi.json -o ./src/contracts",
"lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
"preview": "vite preview"
Expand All @@ -13,7 +14,7 @@
"@fuel-wallet/react": "workspace:*",
"@fuel-wallet/sdk": "workspace:*",
"@fuel-wallet/types": "workspace:*",
"fuels": "0.58.0",
"fuels": "0.63.0",
"react": "^18.2.0",
"react-dom": "^18.2.0"
},
Expand Down
4 changes: 1 addition & 3 deletions packages/e2e-contract-tests/src/utils/assetId.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,7 @@ export const calculateAssetId = (
) => {
const contractIdBytes = Address.fromAddressOrString(contractId).toBytes();
const subIdBytes = Address.fromAddressOrString(subId).toBytes();
const bytesToHash = Array.from(contractIdBytes).concat(
Array.from(subIdBytes),
);
const bytesToHash = Uint8Array.from([...contractIdBytes, ...subIdBytes]);
const assetId = hash(bytesToHash);
return assetId;
};
4 changes: 2 additions & 2 deletions packages/react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"peerDependencies": {
"@fuel-ui/css": "0.21.1",
"@fuel-ui/react": "0.21.1",
"fuels": ">=0.58.0"
"fuels": ">=0.63.0"
},
"dependencies": {
"@tanstack/react-query": "^4.36.1",
Expand All @@ -38,6 +38,6 @@
"devDependencies": {
"@types/chrome": "^0.0.246",
"tsup": "^7.2.0",
"fuels": "0.58.0"
"fuels": "0.63.0"
}
}
4 changes: 2 additions & 2 deletions packages/sdk/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,12 @@
"xstate": "^4.38.2"
},
"peerDependencies": {
"fuels": ">=0.58.0"
"fuels": ">=0.63.0"
},
"devDependencies": {
"@fuel-wallet/types": "workspace:*",
"@types/uuid": "^9.0.5",
"fuels": "0.58.0",
"fuels": "0.63.0",
"jest-webextension-mock": "^3.8.9",
"tsup": "^7.2.0"
}
Expand Down
2 changes: 1 addition & 1 deletion packages/sdk/src/Fuel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export class Fuel extends FuelWalletConnection {
// Listen for network changes and connect the provider
// selected network from the user
this.on(FuelWalletEvents.network, async (network) => {
FuelWeb3Privates.provider?.switchUrl(network.url);
FuelWeb3Privates.provider?.connect(network.url);
});

return FuelWeb3Privates.provider;
Expand Down
2 changes: 1 addition & 1 deletion packages/test-utils/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"ts:check": "pnpm tsc --noEmit"
},
"dependencies": {
"fuels": "0.58.0"
"fuels": "0.63.0"
},
"devDependencies": {
"tsup": "^7.2.0"
Expand Down
4 changes: 2 additions & 2 deletions packages/types/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
"json-rpc-2.0": "^1.6.0"
},
"peerDependencies": {
"fuels": ">=0.58.0"
"fuels": ">=0.63.0"
},
"devDependencies": {
"fuels": "0.58.0"
"fuels": "0.63.0"
}
}
Loading

0 comments on commit f683bae

Please sign in to comment.