Skip to content

Commit

Permalink
refactor: purge old abi format from codebase (#1094)
Browse files Browse the repository at this point in the history
Purged old ABI format from code base
  • Loading branch information
nedsalk authored Jul 14, 2023
1 parent b1c240a commit 8d992c4
Show file tree
Hide file tree
Showing 75 changed files with 3,656 additions and 3,681 deletions.
9 changes: 9 additions & 0 deletions .changeset/chilled-actors-refuse.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
"@fuel-ts/abi-coder": minor
"@fuel-ts/contract": minor
"@fuel-ts/predicate": minor
"@fuel-ts/program": minor
"@fuel-ts/script": minor
---

Purged codebase of old ABI format.
4 changes: 2 additions & 2 deletions apps/docs-snippets/projects/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { getForcProject } from '@fuel-ts/utils/test-utils';
import type { JsonFlatAbi } from 'fuels';
import type { JsonAbi } from 'fuels';
import { join } from 'path';

export enum SnippetProjectEnum {
Expand All @@ -24,4 +24,4 @@ export enum SnippetProjectEnum {
}

export const getSnippetProjectArtifacts = (project: SnippetProjectEnum) =>
getForcProject<JsonFlatAbi>(join(__dirname, project));
getForcProject<JsonAbi>(join(__dirname, project));
2 changes: 1 addition & 1 deletion apps/docs-snippets/src/guide/contracts/logs.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ describe(__filename, () => {
expect(new BN(logs[0]).toNumber()).toBe(value1);
expect(logs[1]).toBe(value2);
expect(logs[2]).toBe(value3);
expect([logs[3], logs[4], logs[5]]).toEqual(value4);
expect(logs[3]).toEqual(value4);
// #endregion log-2
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -17,37 +17,14 @@ describe(__filename, () => {
const assetIdB = '0x0101010101010101010101010101010101010101010101010101010101010101';
const assetIdA = '0x0202020202020202020202020202020202020202020202020202020202020202';

const { binHelixfied: scriptBin } = getSnippetProjectArtifacts(
const { binHelixfied: scriptBin, abiContents } = getSnippetProjectArtifacts(
SnippetProjectEnum.SCRIPT_TRANSFER_TO_CONTRACT
);

const { abiContents: contractAbi, binHelixfied: contractBin } = getSnippetProjectArtifacts(
SnippetProjectEnum.ECHO_VALUES
);

const scriptAbiTypes = [
{
name: 'contract_address',
type: 'b256',
},
{
name: 'asset_a',
type: 'b256',
},
{
name: 'amount_asset_a',
type: 'u64',
},
{
name: 'asset_b',
type: 'b256',
},
{
name: 'amount_asset_b',
type: 'u64',
},
];

beforeAll(async () => {
const seedQuantities: CoinQuantityLike[] = [
[1000, assetIdA],
Expand Down Expand Up @@ -88,7 +65,7 @@ describe(__filename, () => {

// 4. Populate the script data and inputs/outputs
request
.setData(scriptAbiTypes, scriptArguments)
.setData(abiContents, scriptArguments)
.addContractInputAndOutput(contract.id)
.addResourceInputsAndOutputs(resources);

Expand Down
4 changes: 2 additions & 2 deletions internal/check-imports/src/references.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { AbiCoder, StringCoder } from '@fuel-ts/abi-coder';
import { Interface, StringCoder } from '@fuel-ts/abi-coder';
import { AbiTypeGen } from '@fuel-ts/abi-typegen';
import { runCliAction } from '@fuel-ts/abi-typegen/cli';
import { runTypegen } from '@fuel-ts/abi-typegen/runTypegen';
Expand Down Expand Up @@ -36,7 +36,7 @@ const { log } = console;
/**
* abi-coder
*/
log(AbiCoder);
log(Interface);
log(StringCoder);
log(new StringCoder(8));

Expand Down
Loading

0 comments on commit 8d992c4

Please sign in to comment.