Skip to content

Commit

Permalink
test(helios-vesting-cancel.test): add a test for the importable const
Browse files Browse the repository at this point in the history
BREAKING CHANGE:
  • Loading branch information
aleeusgr committed Jun 1, 2023
1 parent bc41912 commit 277b314
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions tests/helios-vesting-cancel.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import {
Value,
} from "@hyperionbt/helios";
import {lockAda} from './src/lockAda.ts';
import {cancelVesting} from './src/cancelVesting.ts';

describe("a vesting contract: Cancel transaction", async () => {

Expand Down Expand Up @@ -137,6 +138,28 @@ describe("a vesting contract: Cancel transaction", async () => {

const oracle = await alice.utxos;

// think about which is which.
expect(oracle[2].value.dump().lovelace).toBe('9546007');
expect(oracle[1].value.dump().lovelace).toBe('10000000');//
expect(oracle[0].value.dump().lovelace).toBe('50000000');// collateral?
})
it ("tests cancelVesting.ts", async ({network, alice, bob, program}) => {
const optimize = false; // need to add it to the context
const compiledScript = program.compile(optimize);
const validatorHash = compiledScript.validatorHash;
const validatorAddress = Address.fromValidatorHash(validatorHash);

const adaQty = 10;
const duration = 1000000;
// --------------------maybe-program-?------v
await lockAda(network!, alice!, bob!, validatorHash, adaQty, duration);
expect((await alice.utxos)[0].value.dump().lovelace).toBe('50000000');
expect((await alice.utxos)[1].value.dump().lovelace).toBe('9755287');

await cancelVesting();

const oracle = await alice.utxos;

// think about which is which.
expect(oracle[2].value.dump().lovelace).toBe('9546007');
expect(oracle[1].value.dump().lovelace).toBe('10000000');//
Expand Down

0 comments on commit 277b314

Please sign in to comment.