feat: expose instruction types and refactor

This commit is contained in:
Justin Starry
2020-02-28 18:43:10 +08:00
committed by Michael Vines
parent 8b95f41c51
commit 0cdf532419
7 changed files with 305 additions and 165 deletions

View File

@ -10,7 +10,6 @@ import {
LAMPORTS_PER_SOL,
StakeAuthorizationLayout,
StakeInstruction,
StakeInstructionLayout,
StakeProgram,
SystemInstruction,
SystemProgram,
@ -197,7 +196,7 @@ test('StakeInstructions', () => {
const stakeInstruction = StakeInstruction.from(
createWithSeedTransaction.instructions[1],
);
expect(stakeInstruction.type).toEqual(StakeInstructionLayout.Initialize);
expect(stakeInstruction.type).toEqual('Initialize');
expect(() => {
StakeInstruction.from(createWithSeedTransaction.instructions[0]);
@ -216,9 +215,7 @@ test('StakeInstructions', () => {
const anotherStakeInstruction = StakeInstruction.from(
delegateTransaction.instructions[0],
);
expect(anotherStakeInstruction.type).toEqual(
StakeInstructionLayout.DelegateStake,
);
expect(anotherStakeInstruction.type).toEqual('Delegate');
});
test('live staking actions', async () => {