Skip to content

Commit

Permalink
Fix integretion tests
Browse files Browse the repository at this point in the history
  • Loading branch information
danielailie committed Sep 5, 2024
1 parent 42bf1c6 commit dada969
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/smartcontracts/codec/managedDecimal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export class ManagedDecimalCodec {
return new ManagedDecimalValue(new BigNumber(0), 2);
}

const isUsize = type.getMetadata() === "usize";
const isUsize = type.getMetadata() == "usize";

if (isUsize) {
const u32Size = 4;
Expand Down
6 changes: 3 additions & 3 deletions src/smartcontracts/interaction.local.net.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ describe("test smart contract interactor", function () {

// log
let mdLnInteraction = <Interaction>contract.methods
.managed_decimal_ln([new ManagedDecimalValue(23, 9)])
.managed_decimal_ln([new ManagedDecimalValue(23000000000, 9)])
.withGasLimit(10000000)
.withChainID(network.ChainID)
.withSender(alice.address)
Expand Down Expand Up @@ -287,7 +287,7 @@ describe("test smart contract interactor", function () {
let { bundle: bundleMDLn } = await controller.execute(mdLnInteraction, mdLnTransaction);
assert.isTrue(bundleMDLn.returnCode.equals(ReturnCode.Ok));
assert.lengthOf(bundleMDLn.values, 1);
assert.deepEqual(bundleMDLn.values[0], new ManagedDecimalSignedValue(3.135553845, 9));
assert.deepEqual(bundleMDLn.values[0], new ManagedDecimalSignedValue(3135553845, 9));

// addition with var decimals
await signTransaction({ transaction: additionVarTransaction, wallet: alice });
Expand Down Expand Up @@ -357,7 +357,7 @@ describe("test smart contract interactor", function () {
assert.deepEqual(valueAfterDecrement!.valueOf(), new BigNumber(0));
});

it("should interact with 'counter' (local testnet) using the SmartContractTransactionsFactory", async function () {
it("should interact with 'basic-features' (local testnet) and use managed Decimal", async function () {
this.timeout(120000);

let abiRegistry = await loadAbiRegistry("src/testdata/counter.abi.json");
Expand Down
2 changes: 1 addition & 1 deletion src/smartcontracts/typesystem/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export class Type {

private readonly name: string;
private readonly typeParameters: Type[];
protected readonly metadata: any;
protected readonly metadata: string;
private readonly cardinality: TypeCardinality;

public constructor(
Expand Down

0 comments on commit dada969

Please sign in to comment.