From a69b264ebca70967fe16385bb8a7024a485d06b0 Mon Sep 17 00:00:00 2001 From: Anderson Arboleya Date: Sat, 6 Jul 2024 08:03:00 -0300 Subject: [PATCH 1/8] Upgrading fuel-core to `0.31.0` --- internal/fuel-core/VERSION | 2 +- packages/account/src/providers/provider.test.ts | 2 +- packages/versions/src/lib/getBuiltinVersions.ts | 2 +- templates/nextjs/sway-programs/fuel-toolchain.toml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/internal/fuel-core/VERSION b/internal/fuel-core/VERSION index c25c8e5b74..26bea73e81 100644 --- a/internal/fuel-core/VERSION +++ b/internal/fuel-core/VERSION @@ -1 +1 @@ -0.30.0 +0.31.0 diff --git a/packages/account/src/providers/provider.test.ts b/packages/account/src/providers/provider.test.ts index 7edd8da243..ed70bc27c7 100644 --- a/packages/account/src/providers/provider.test.ts +++ b/packages/account/src/providers/provider.test.ts @@ -63,7 +63,7 @@ describe('Provider', () => { const version = await provider.getVersion(); - expect(version).toEqual('0.30.0'); + expect(version).toEqual('0.31.0'); }); it('can call()', async () => { diff --git a/packages/versions/src/lib/getBuiltinVersions.ts b/packages/versions/src/lib/getBuiltinVersions.ts index e1c32a8a1d..b1d650e498 100644 --- a/packages/versions/src/lib/getBuiltinVersions.ts +++ b/packages/versions/src/lib/getBuiltinVersions.ts @@ -1,7 +1,7 @@ export function getBuiltinVersions() { return { FORC: '0.61.2', - FUEL_CORE: '0.30.0', + FUEL_CORE: '0.31.0', FUELS: '0.91.0', }; } diff --git a/templates/nextjs/sway-programs/fuel-toolchain.toml b/templates/nextjs/sway-programs/fuel-toolchain.toml index ec0869e869..04eec7eea3 100644 --- a/templates/nextjs/sway-programs/fuel-toolchain.toml +++ b/templates/nextjs/sway-programs/fuel-toolchain.toml @@ -3,4 +3,4 @@ channel = "testnet" [components] forc = "0.61.2" -fuel-core = "0.30.0" +fuel-core = "0.31.0" From 1d1c868465a6cf3cafd9be73b86cb43988e7d5a7 Mon Sep 17 00:00:00 2001 From: Anderson Arboleya Date: Sat, 6 Jul 2024 08:03:16 -0300 Subject: [PATCH 2/8] Upgrading GraphQL schema --- .../src/providers/fuel-core-schema.graphql | 67 ++++++++++++------- 1 file changed, 43 insertions(+), 24 deletions(-) diff --git a/packages/account/src/providers/fuel-core-schema.graphql b/packages/account/src/providers/fuel-core-schema.graphql index 577a9bd765..dca24b863a 100644 --- a/packages/account/src/providers/fuel-core-schema.graphql +++ b/packages/account/src/providers/fuel-core-schema.graphql @@ -1,3 +1,19 @@ +""" +Indicates that an Input Object is a OneOf Input Object (and thus requires + exactly one of its field be provided) +""" +directive @oneOf on INPUT_OBJECT + +""" +Provides a scalar specification URL for specifying the behavior of custom scalar types. +""" +directive @specifiedBy( + """ + URL that specifies the behavior of this scalar. + """ + url: String! +) on SCALAR + scalar Address scalar AssetId @@ -30,14 +46,14 @@ An edge in a connection. """ type BalanceEdge { """ - A cursor for use in pagination + The item at the end of the edge """ - cursor: String! + node: Balance! """ - The item at the end of the edge + A cursor for use in pagination """ - node: Balance! + cursor: String! } input BalanceFilterInput { @@ -53,6 +69,7 @@ type Block { height: U32! header: Header! consensus: Consensus! + transactionIds: [TransactionId!]! transactions: [Transaction!]! } @@ -78,14 +95,14 @@ An edge in a connection. """ type BlockEdge { """ - A cursor for use in pagination + The item at the end of the edge """ - cursor: String! + node: Block! """ - The item at the end of the edge + A cursor for use in pagination """ - node: Block! + cursor: String! } scalar BlockId @@ -157,14 +174,14 @@ An edge in a connection. """ type CoinEdge { """ - A cursor for use in pagination + The item at the end of the edge """ - cursor: String! + node: Coin! """ - The item at the end of the edge + A cursor for use in pagination """ - node: Coin! + cursor: String! } input CoinFilterInput { @@ -249,14 +266,14 @@ An edge in a connection. """ type ContractBalanceEdge { """ - A cursor for use in pagination + The item at the end of the edge """ - cursor: String! + node: ContractBalance! """ - The item at the end of the edge + A cursor for use in pagination """ - node: ContractBalance! + cursor: String! } input ContractBalanceFilterInput { @@ -332,6 +349,7 @@ input ExcludeInput { type FailureStatus { transactionId: TransactionId! + blockHeight: U32! block: Block! time: Tai64Timestamp! reason: String! @@ -672,14 +690,14 @@ An edge in a connection. """ type MessageEdge { """ - A cursor for use in pagination + The item at the end of the edge """ - cursor: String! + node: Message! """ - The item at the end of the edge + A cursor for use in pagination """ - node: Message! + cursor: String! } type MessageProof { @@ -1222,6 +1240,7 @@ type Subscription { type SuccessStatus { transactionId: TransactionId! + blockHeight: U32! block: Block! time: Tai64Timestamp! programState: ProgramState @@ -1294,14 +1313,14 @@ An edge in a connection. """ type TransactionEdge { """ - A cursor for use in pagination + The item at the end of the edge """ - cursor: String! + node: Transaction! """ - The item at the end of the edge + A cursor for use in pagination """ - node: Transaction! + cursor: String! } scalar TransactionId From 1ca97a881241136424577a4f84cca64dbb655e53 Mon Sep 17 00:00:00 2001 From: Anderson Arboleya Date: Sat, 6 Jul 2024 08:05:35 -0300 Subject: [PATCH 3/8] Adding changeset --- .changeset/ninety-candles-perform.md | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 .changeset/ninety-candles-perform.md diff --git a/.changeset/ninety-candles-perform.md b/.changeset/ninety-candles-perform.md new file mode 100644 index 0000000000..26a91f8992 --- /dev/null +++ b/.changeset/ninety-candles-perform.md @@ -0,0 +1,7 @@ +--- +"@internal/fuel-core": patch +"@fuel-ts/versions": patch +"@fuel-ts/account": patch +--- + +chore: upgrading `fuel-core` to `0.31.0` From 917e380225c415fab9cc896b345eed16aab4d322 Mon Sep 17 00:00:00 2001 From: Anderson Arboleya Date: Sat, 6 Jul 2024 09:05:53 -0300 Subject: [PATCH 4/8] Decreasing page sizes to conform with new limits --- packages/account/src/account.test.ts | 12 ++++++------ packages/account/src/account.ts | 6 +++--- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/packages/account/src/account.test.ts b/packages/account/src/account.test.ts index 9bdaf53fcd..e447c4a70c 100644 --- a/packages/account/src/account.test.ts +++ b/packages/account/src/account.test.ts @@ -73,7 +73,7 @@ describe('Account', () => { expect(assetC?.amount.gt(1)).toBeTruthy(); }); - it('should throw if coins length is higher than 9999', async () => { + it('should throw if coins length is higher than 100', async () => { const dummyCoins: Coin[] = new Array(10000); vi.spyOn(Provider.prototype, 'getCoins').mockImplementation(async () => @@ -96,7 +96,7 @@ describe('Account', () => { expect(result).toBeUndefined(); expect((error).message).toEqual( - 'Wallets containing more than 9999 coins exceed the current supported limit.' + 'Wallets containing more than 100 coins exceed the current supported limit.' ); }); @@ -139,7 +139,7 @@ describe('Account', () => { expect(messages.length).toEqual(1); }); - it('should throw if messages length is higher than 9999', async () => { + it('should throw if messages length is higher than 100', async () => { const dummyMessages: Message[] = new Array(10000); vi.spyOn(Provider.prototype, 'getMessages').mockImplementation(async () => @@ -162,7 +162,7 @@ describe('Account', () => { expect(result).toBeUndefined(); expect((error).message).toEqual( - 'Wallets containing more than 9999 messages exceed the current supported limit.' + 'Wallets containing more than 100 messages exceed the current supported limit.' ); }); @@ -186,7 +186,7 @@ describe('Account', () => { expect(balances.length).toBeGreaterThanOrEqual(1); }); - it('should throw if balances length is higher than 9999', async () => { + it('should throw if balances length is higher than 100', async () => { const dummyBalances: CoinQuantity[] = new Array(10000); vi.spyOn(Provider.prototype, 'getBalances').mockImplementation(async () => @@ -208,7 +208,7 @@ describe('Account', () => { expect(result).toBeUndefined(); expect((error).message).toEqual( - 'Wallets containing more than 9999 balances exceed the current supported limit.' + 'Wallets containing more than 100 balances exceed the current supported limit.' ); }); diff --git a/packages/account/src/account.ts b/packages/account/src/account.ts index 2da178ef22..6cb2cf7b53 100644 --- a/packages/account/src/account.ts +++ b/packages/account/src/account.ts @@ -151,7 +151,7 @@ export class Account extends AbstractAccount { async getCoins(assetId?: BytesLike): Promise { const coins = []; - const pageSize = 9999; + const pageSize = 100; let cursor; // eslint-disable-next-line no-unreachable-loop for (;;) { @@ -185,7 +185,7 @@ export class Account extends AbstractAccount { async getMessages(): Promise { const messages = []; - const pageSize = 9999; + const pageSize = 100; let cursor; // eslint-disable-next-line no-unreachable-loop for (;;) { @@ -231,7 +231,7 @@ export class Account extends AbstractAccount { async getBalances(): Promise { const balances = []; - const pageSize = 9999; + const pageSize = 100; let cursor; // eslint-disable-next-line no-unreachable-loop for (;;) { From e6104723d06496478e4a89f70006eb9f0a5896a1 Mon Sep 17 00:00:00 2001 From: Anderson Arboleya Date: Mon, 8 Jul 2024 08:30:58 -0300 Subject: [PATCH 5/8] Enabling devnet e2es --- .github/workflows/test.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 372d9dc8a2..59389c0f39 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -107,7 +107,7 @@ jobs: env: TESTNET_WALLET_PVT_KEY: ${{ secrets.TESTNET_WALLET_PVT_KEY }} # uncomment the below line to test against devnet - # DEVNET_WALLET_PVT_KEY: ${{ secrets.DEVNET_WALLET_PVT_KEY }} + DEVNET_WALLET_PVT_KEY: ${{ secrets.DEVNET_WALLET_PVT_KEY }} test: if: github.base_ref == 'master' || github.ref_name == 'master' From 5664443f8158d8fd1f11e24deab32a064bfce338 Mon Sep 17 00:00:00 2001 From: Anderson Arboleya Date: Mon, 8 Jul 2024 11:51:37 -0300 Subject: [PATCH 6/8] Disabling e2es for devnet --- .github/workflows/test.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 59389c0f39..372d9dc8a2 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -107,7 +107,7 @@ jobs: env: TESTNET_WALLET_PVT_KEY: ${{ secrets.TESTNET_WALLET_PVT_KEY }} # uncomment the below line to test against devnet - DEVNET_WALLET_PVT_KEY: ${{ secrets.DEVNET_WALLET_PVT_KEY }} + # DEVNET_WALLET_PVT_KEY: ${{ secrets.DEVNET_WALLET_PVT_KEY }} test: if: github.base_ref == 'master' || github.ref_name == 'master' From 3fb86a9012c1432e7d6df663c153a498d3a12388 Mon Sep 17 00:00:00 2001 From: Anderson Arboleya Date: Mon, 8 Jul 2024 12:12:57 -0300 Subject: [PATCH 7/8] Adjusting changeset --- .changeset/ninety-candles-perform.md | 1 + 1 file changed, 1 insertion(+) diff --git a/.changeset/ninety-candles-perform.md b/.changeset/ninety-candles-perform.md index 26a91f8992..e73018e363 100644 --- a/.changeset/ninety-candles-perform.md +++ b/.changeset/ninety-candles-perform.md @@ -1,4 +1,5 @@ --- +"create-fuels": patch "@internal/fuel-core": patch "@fuel-ts/versions": patch "@fuel-ts/account": patch From ee49080d9883342c313505c419bc2f726155a3b9 Mon Sep 17 00:00:00 2001 From: Anderson Arboleya Date: Mon, 8 Jul 2024 18:23:34 -0300 Subject: [PATCH 8/8] Re-adjusting query limits --- packages/account/src/account.test.ts | 12 ++++++------ packages/account/src/account.ts | 6 +++--- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/packages/account/src/account.test.ts b/packages/account/src/account.test.ts index e447c4a70c..98ce2e8896 100644 --- a/packages/account/src/account.test.ts +++ b/packages/account/src/account.test.ts @@ -73,7 +73,7 @@ describe('Account', () => { expect(assetC?.amount.gt(1)).toBeTruthy(); }); - it('should throw if coins length is higher than 100', async () => { + it('should throw if coins length is higher than 512', async () => { const dummyCoins: Coin[] = new Array(10000); vi.spyOn(Provider.prototype, 'getCoins').mockImplementation(async () => @@ -96,7 +96,7 @@ describe('Account', () => { expect(result).toBeUndefined(); expect((error).message).toEqual( - 'Wallets containing more than 100 coins exceed the current supported limit.' + 'Wallets containing more than 512 coins exceed the current supported limit.' ); }); @@ -139,7 +139,7 @@ describe('Account', () => { expect(messages.length).toEqual(1); }); - it('should throw if messages length is higher than 100', async () => { + it('should throw if messages length is higher than 512', async () => { const dummyMessages: Message[] = new Array(10000); vi.spyOn(Provider.prototype, 'getMessages').mockImplementation(async () => @@ -162,7 +162,7 @@ describe('Account', () => { expect(result).toBeUndefined(); expect((error).message).toEqual( - 'Wallets containing more than 100 messages exceed the current supported limit.' + 'Wallets containing more than 512 messages exceed the current supported limit.' ); }); @@ -186,7 +186,7 @@ describe('Account', () => { expect(balances.length).toBeGreaterThanOrEqual(1); }); - it('should throw if balances length is higher than 100', async () => { + it('should throw if balances length is higher than 9999', async () => { const dummyBalances: CoinQuantity[] = new Array(10000); vi.spyOn(Provider.prototype, 'getBalances').mockImplementation(async () => @@ -208,7 +208,7 @@ describe('Account', () => { expect(result).toBeUndefined(); expect((error).message).toEqual( - 'Wallets containing more than 100 balances exceed the current supported limit.' + 'Wallets containing more than 9999 balances exceed the current supported limit.' ); }); diff --git a/packages/account/src/account.ts b/packages/account/src/account.ts index 6cb2cf7b53..6e4117da77 100644 --- a/packages/account/src/account.ts +++ b/packages/account/src/account.ts @@ -151,7 +151,7 @@ export class Account extends AbstractAccount { async getCoins(assetId?: BytesLike): Promise { const coins = []; - const pageSize = 100; + const pageSize = 512; let cursor; // eslint-disable-next-line no-unreachable-loop for (;;) { @@ -185,7 +185,7 @@ export class Account extends AbstractAccount { async getMessages(): Promise { const messages = []; - const pageSize = 100; + const pageSize = 512; let cursor; // eslint-disable-next-line no-unreachable-loop for (;;) { @@ -231,7 +231,7 @@ export class Account extends AbstractAccount { async getBalances(): Promise { const balances = []; - const pageSize = 100; + const pageSize = 9999; let cursor; // eslint-disable-next-line no-unreachable-loop for (;;) {