Skip to content

Commit

Permalink
test out u256 support
Browse files Browse the repository at this point in the history
  • Loading branch information
Dhaiwat10 committed Feb 23, 2024
1 parent a59a0f2 commit 06727de
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
10 changes: 10 additions & 0 deletions apps/docs-snippets/src/guide/types/numbers.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,4 +70,14 @@ describe(__filename, () => {
expect(fuelsBigNum.toNumber()).toEqual(originalNumber);
// #endregion numbers-docs-5
});

test('u256', async () => {
const contract = await createAndDeployContractFromProject(DocSnippetProjectsEnum.ECHO_VALUES);

const originalNumber = 20;

const { value } = await contract.functions.echo_u256(bn(originalNumber)).call();

expect(value.toNumber()).toEqual(originalNumber);
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ abi EchoValues {
fn echo_b512(input: B512) -> B512;

fn echo_u64(value: u64) -> u64;

fn echo_u256(value: u256) -> u256;
}

impl EchoValues for Contract {
Expand Down Expand Up @@ -49,5 +51,9 @@ impl EchoValues for Contract {
fn echo_u64(value: u64) -> u64 {
value
}

fn echo_u256(value: u256) -> u256 {
value
}
}
// #endregion understanding-fuel-binary-file

0 comments on commit 06727de

Please sign in to comment.