From 865f7631540465df2a03edc2359e0b7f3410de25 Mon Sep 17 00:00:00 2001 From: Peter Smith Date: Wed, 26 Jun 2024 14:14:16 +0100 Subject: [PATCH 1/4] fix: re-sync the GraphQL schema --- .../account/src/providers/fuel-core-schema.graphql | 2 ++ packages/account/src/providers/operations.graphql | 6 ++++++ packages/account/test/fixtures/chain.ts | 10 ++++++++++ .../test/fixtures/project/.fuels/chainConfig.json | 12 ++++++++++++ .../src/utils/defaultSnapshots/chainConfig.json | 12 ++++++++++++ 5 files changed, 42 insertions(+) diff --git a/packages/account/src/providers/fuel-core-schema.graphql b/packages/account/src/providers/fuel-core-schema.graphql index e6b2ed61ff9..577a9bd7655 100644 --- a/packages/account/src/providers/fuel-core-schema.graphql +++ b/packages/account/src/providers/fuel-core-schema.graphql @@ -442,6 +442,8 @@ type GasCosts { xor: U64! xori: U64! alocDependentCost: DependentCost! + cfe: DependentCost! + cfeiDependentCost: DependentCost! call: DependentCost! ccp: DependentCost! croo: DependentCost! diff --git a/packages/account/src/providers/operations.graphql b/packages/account/src/providers/operations.graphql index e6742fa2393..a2eb307e00c 100644 --- a/packages/account/src/providers/operations.graphql +++ b/packages/account/src/providers/operations.graphql @@ -398,6 +398,12 @@ fragment GasCostsFragment on GasCosts { alocDependentCost { ...DependentCostFragment } + cfe { + ...DependentCostFragment + } + cfeiDependentCost { + ...DependentCostFragment + } call { ...DependentCostFragment } diff --git a/packages/account/test/fixtures/chain.ts b/packages/account/test/fixtures/chain.ts index 75772573ca2..3be91c9af35 100644 --- a/packages/account/test/fixtures/chain.ts +++ b/packages/account/test/fixtures/chain.ts @@ -144,6 +144,16 @@ export const MOCK_CHAIN: GqlChainInfoFragment = { base: '2', unitsPerGas: '214', }, + cfe: { + type: 'HeavyOperation', + base: '2', + gasPerUnit: '0', + }, + cfeiDependentCost: { + type: 'HeavyOperation', + base: '2', + gasPerUnit: '0', + }, call: { type: 'LightOperation', base: '144', diff --git a/packages/fuels/test/fixtures/project/.fuels/chainConfig.json b/packages/fuels/test/fixtures/project/.fuels/chainConfig.json index 422b73de6fc..356978289d7 100644 --- a/packages/fuels/test/fixtures/project/.fuels/chainConfig.json +++ b/packages/fuels/test/fixtures/project/.fuels/chainConfig.json @@ -135,6 +135,18 @@ "unitsPerGas": "214" } }, + "cfe": { + "HeavyOperation": { + "base": 2, + "gasPerUnit": 0 + } + }, + "cfeiDependentCost": { + "HeavyOperation": { + "base": 2, + "gasPerUnit": 0 + } + }, "call": { "LightOperation": { "base": 21687, diff --git a/packages/utils/src/utils/defaultSnapshots/chainConfig.json b/packages/utils/src/utils/defaultSnapshots/chainConfig.json index cf7b258e219..782f9d297b0 100644 --- a/packages/utils/src/utils/defaultSnapshots/chainConfig.json +++ b/packages/utils/src/utils/defaultSnapshots/chainConfig.json @@ -135,6 +135,18 @@ "unitsPerGas": "214" } }, + "cfe": { + "HeavyOperation": { + "base": 2, + "gasPerUnit": 0 + } + }, + "cfeiDependentCost": { + "HeavyOperation": { + "base": 2, + "gasPerUnit": 0 + } + }, "call": { "LightOperation": { "base": 18190, From 10bcf89a6f0f3a1da9812427387a402882bd0a93 Mon Sep 17 00:00:00 2001 From: Peter Smith Date: Wed, 26 Jun 2024 14:16:22 +0100 Subject: [PATCH 2/4] fix: incorrect types in chain config json --- packages/fuels/test/fixtures/project/.fuels/chainConfig.json | 4 ++-- packages/utils/src/utils/defaultSnapshots/chainConfig.json | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/fuels/test/fixtures/project/.fuels/chainConfig.json b/packages/fuels/test/fixtures/project/.fuels/chainConfig.json index 356978289d7..98f9c29c1a9 100644 --- a/packages/fuels/test/fixtures/project/.fuels/chainConfig.json +++ b/packages/fuels/test/fixtures/project/.fuels/chainConfig.json @@ -131,8 +131,8 @@ "xori": 2, "alocDependentCost": { "LightOperation": { - "base": "2", - "unitsPerGas": "214" + "base": 2, + "unitsPerGas": 214 } }, "cfe": { diff --git a/packages/utils/src/utils/defaultSnapshots/chainConfig.json b/packages/utils/src/utils/defaultSnapshots/chainConfig.json index 782f9d297b0..563a7286278 100644 --- a/packages/utils/src/utils/defaultSnapshots/chainConfig.json +++ b/packages/utils/src/utils/defaultSnapshots/chainConfig.json @@ -131,8 +131,8 @@ "xori": 2, "alocDependentCost": { "LightOperation": { - "base": "2", - "unitsPerGas": "214" + "base": 2, + "unitsPerGas": 214 } }, "cfe": { From fa522501bfddd4a3b9f5f9a08d4b1bffcc7d859b Mon Sep 17 00:00:00 2001 From: Peter Smith Date: Wed, 26 Jun 2024 14:17:58 +0100 Subject: [PATCH 3/4] chore: changeset --- .changeset/wild-maps-build.md | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 .changeset/wild-maps-build.md diff --git a/.changeset/wild-maps-build.md b/.changeset/wild-maps-build.md new file mode 100644 index 00000000000..1b6f8bc2e11 --- /dev/null +++ b/.changeset/wild-maps-build.md @@ -0,0 +1,6 @@ +--- +"@fuel-ts/utils": patch +"@fuel-ts/account": patch +--- + +fix: sync chain config schema From 336d81bb46fdfa3b5aaa2d6813cfd202dae01e64 Mon Sep 17 00:00:00 2001 From: Peter Smith Date: Wed, 26 Jun 2024 15:12:55 +0100 Subject: [PATCH 4/4] chore: update `alocDependentCost` to a HeavyOperation --- packages/account/test/fixtures/chain.ts | 4 ++-- packages/fuels/test/fixtures/project/.fuels/chainConfig.json | 4 ++-- packages/utils/src/utils/defaultSnapshots/chainConfig.json | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/packages/account/test/fixtures/chain.ts b/packages/account/test/fixtures/chain.ts index 3be91c9af35..19ba34ae30f 100644 --- a/packages/account/test/fixtures/chain.ts +++ b/packages/account/test/fixtures/chain.ts @@ -140,9 +140,9 @@ export const MOCK_CHAIN: GqlChainInfoFragment = { xor: '1', xori: '1', alocDependentCost: { - type: 'LightOperation', + type: 'HeavyOperation', base: '2', - unitsPerGas: '214', + gasPerUnit: '0', }, cfe: { type: 'HeavyOperation', diff --git a/packages/fuels/test/fixtures/project/.fuels/chainConfig.json b/packages/fuels/test/fixtures/project/.fuels/chainConfig.json index 98f9c29c1a9..2977a19e76f 100644 --- a/packages/fuels/test/fixtures/project/.fuels/chainConfig.json +++ b/packages/fuels/test/fixtures/project/.fuels/chainConfig.json @@ -130,9 +130,9 @@ "xor": 2, "xori": 2, "alocDependentCost": { - "LightOperation": { + "HeavyOperation": { "base": 2, - "unitsPerGas": 214 + "gasPerUnit": 0 } }, "cfe": { diff --git a/packages/utils/src/utils/defaultSnapshots/chainConfig.json b/packages/utils/src/utils/defaultSnapshots/chainConfig.json index 563a7286278..e4ea2be7c8d 100644 --- a/packages/utils/src/utils/defaultSnapshots/chainConfig.json +++ b/packages/utils/src/utils/defaultSnapshots/chainConfig.json @@ -130,9 +130,9 @@ "xor": 2, "xori": 2, "alocDependentCost": { - "LightOperation": { + "HeavyOperation": { "base": 2, - "unitsPerGas": 214 + "gasPerUnit": 0 } }, "cfe": {