Skip to content

Commit

Permalink
updated baker account for staking tests (#2951)
Browse files Browse the repository at this point in the history
* updated baker account for staking tests

* updated paris tests to not run on oxfordnet
  • Loading branch information
dsawali authored May 6, 2024
1 parent e5a73d5 commit 0840424
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions integration-tests/__tests__/contract/operations/staking.spec.ts
Original file line number Diff line number Diff line change
@@ -1,31 +1,34 @@
import { CONFIGS } from "../../../config";
import { Protocols } from '@taquito/taquito';
import { ProtoGreaterOrEqual } from '@taquito/michel-codec';

CONFIGS().forEach(({ lib, rpc, setup }) => {
CONFIGS().forEach(({ lib, rpc, setup, knownBaker, protocol }) => {
const Tezos = lib;
const parisAndAlpha = ProtoGreaterOrEqual(protocol, Protocols.PtParisBQ) ? test : test.skip;

describe(`Staking pseudo operations: ${rpc}`, () => {

beforeAll(async () => {
await setup(true);

const delegateOp = await Tezos.contract.setDelegate({
delegate: 'tz1PZY3tEWmXGasYeehXYqwXuw2Z3iZ6QDnA',
delegate: knownBaker,
source: await Tezos.signer.publicKeyHash()
});

await delegateOp.confirmation();
});

it('should throw an error when the destination specified is not the same as source', async () => {
parisAndAlpha('should throw an error when the destination specified is not the same as source', async () => {
expect(async () => {
const op = await Tezos.contract.stake({
amount: 0.1,
to: 'tz1PZY3tEWmXGasYeehXYqwXuw2Z3iZ6QDnA'
to: knownBaker
});
}).rejects.toThrow();
});

it('should be able to stake funds to a designated delegate', async () => {
parisAndAlpha('should be able to stake funds to a designated delegate', async () => {
const op = await Tezos.contract.stake({
amount: 0.1
});
Expand All @@ -35,7 +38,7 @@ CONFIGS().forEach(({ lib, rpc, setup }) => {
expect(op.status).toEqual('applied');
});

it('should be able to unstake funds from a designated delegate', async () => {
parisAndAlpha('should be able to unstake funds from a designated delegate', async () => {
const op = await Tezos.contract.unstake({
amount: 0.1
});
Expand All @@ -45,7 +48,7 @@ CONFIGS().forEach(({ lib, rpc, setup }) => {
expect(op.status).toEqual('applied');
});

it('should be able to finalize_unstake funds from a designated delegate', async () => {
parisAndAlpha('should be able to finalize_unstake funds from a designated delegate', async () => {
const op = await Tezos.contract.finalizeUnstake({});
await op.confirmation();

Expand Down

0 comments on commit 0840424

Please sign in to comment.