Skip to content

Commit

Permalink
test: updated estimation assertion
Browse files Browse the repository at this point in the history
  • Loading branch information
hui-an-yang committed Sep 23, 2024
1 parent 8184d2e commit bbfe9f5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
10 changes: 5 additions & 5 deletions integration-tests/__tests__/contract/estimation-tests.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,14 +95,14 @@ CONFIGS().forEach(({ lib, setup, knownBaker, createAddress, rpc }) => {
it('Verify .estimate.transfer for internal transfer to allocated implicit', async () => {
const tx = contract.methods.do(MANAGER_LAMBDA.transferImplicit(knownBaker, 5)).toTransferParams();
const estimate = await LowAmountTez.estimate.transfer(tx);
expect(estimate.gasLimit).toEqual(1456);
expect(estimate.gasLimit).toEqual(1457);
expect(estimate.storageLimit).toEqual(0);
expect(estimate.suggestedFeeMutez).toEqual(394);
expect(estimate.burnFeeMutez).toEqual(0);
expect(estimate.minimalFeeMutez).toEqual(374);
expect(estimate.totalCost).toEqual(374);
expect(estimate.usingBaseFeeMutez).toEqual(374);
expect(estimate.consumedMilligas).toEqual(1455970);
expect(estimate.consumedMilligas).toEqual(1456056);
});

it('Verify .estimate.transfer for multiple internal transfers to unallocated account', async () => {
Expand All @@ -119,7 +119,7 @@ CONFIGS().forEach(({ lib, setup, knownBaker, createAddress, rpc }) => {
expect(estimate.minimalFeeMutez).toEqual(445);
expect(estimate.totalCost).toEqual(133945);
expect(estimate.usingBaseFeeMutez).toEqual(445);
expect(estimate.consumedMilligas).toEqual(1570499);
expect(estimate.consumedMilligas).toEqual(1570585);
});

it('Verify .estimate.transfer for internal origination', async () => {
Expand All @@ -132,7 +132,7 @@ CONFIGS().forEach(({ lib, setup, knownBaker, createAddress, rpc }) => {
expect(estimate.minimalFeeMutez).toEqual(421);
expect(estimate.totalCost).toEqual(84671);
expect(estimate.usingBaseFeeMutez).toEqual(421);
expect(estimate.consumedMilligas).toEqual(1866594);
expect(estimate.consumedMilligas).toEqual(1866680);
});

it('Verify .estimate.transfer for multiple internal originations', async () => {
Expand All @@ -145,7 +145,7 @@ CONFIGS().forEach(({ lib, setup, knownBaker, createAddress, rpc }) => {
expect(estimate.minimalFeeMutez).toEqual(539);
expect(estimate.totalCost).toEqual(164039);
expect(estimate.usingBaseFeeMutez).toEqual(539);
expect(estimate.consumedMilligas).toEqual(2391747);
expect(estimate.consumedMilligas).toEqual(2391833);
// Do the actual operation
const op2 = await contract.methods.do(originate2()).send();
await op2.confirmation();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,7 @@ CONFIGS().forEach(({ setup, rpc, lib }) => {
arbitrary: "48656C6C6F20576F726C64", // Hello World
basedOnBlock: 0,
});
console.log(signed)
const pk = await Tezos.signer.publicKey();
console.log(pk)
expect(verifySignature(signed.bytes, pk!, signed.signature, new Uint8Array([3]))).toBe(true);
});

Expand Down

0 comments on commit bbfe9f5

Please sign in to comment.