@@ -3,7 +3,7 @@ import { TransactionType, AddressFormat } from '@bitgo/sdk-core';
33import * as testData from '../resources' ;
44import { KeyPair , TransactionBuilderFactory } from '../../src' ;
55import { coins } from '@bitgo/statics' ;
6- import { Transaction } from '../../src/lib/transaction' ;
6+ import { CertType , Transaction } from '../../src/lib/transaction' ;
77import * as Utils from '../../src/lib/utils' ;
88
99describe ( 'ADA Staking Activate Transaction Builder' , async ( ) => {
@@ -21,19 +21,24 @@ describe('ADA Staking Activate Transaction Builder', async () => {
2121 'addr1q8rm9z7w4yx5gz652kn2q238efvms6t0qelur9nlglun8eu4tr5knj4fu4adelzqhxg8adu5xca4jra0gtllfrpcawyq9psz23' ,
2222 totalInput
2323 ) ;
24- txBuilder . stakingCredential ( keyPairStake . getKeys ( ) . pub , '7a623c48348501c2380e60ac2307fcd1b67df4218f819930821a15b3' ) ;
24+ txBuilder . stakingCredential (
25+ keyPairStake . getKeys ( ) . pub ,
26+ '7a623c48348501c2380e60ac2307fcd1b67df4218f819930821a15b3' ,
27+ 'always-abstain'
28+ ) ;
2529 txBuilder . ttl ( 800000000 ) ;
2630 const tx = ( await txBuilder . build ( ) ) as Transaction ;
2731 should . equal ( tx . type , TransactionType . StakingActivate ) ;
2832 const txData = tx . toJson ( ) ;
2933 const fee = tx . getFee ;
30- txData . certs . length . should . equal ( 2 ) ;
34+ txData . certs . length . should . equal ( 3 ) ;
3135 txData . certs [ 0 ] . type . should . equal ( 0 ) ;
3236 txData . certs [ 1 ] . type . should . equal ( 1 ) ;
37+ txData . certs [ 2 ] . type . should . equal ( CertType . VoteDelegation ) ;
3338
3439 txData . outputs . length . should . equal ( 1 ) ;
3540 txData . outputs [ 0 ] . amount . should . equal ( ( Number ( totalInput ) - 2000000 - Number ( fee ) ) . toString ( ) ) ;
36- fee . should . equal ( '169945 ' ) ;
41+ fee . should . equal ( '171529 ' ) ;
3742 tx . toBroadcastFormat ( ) . should . equal ( testData . rawTx . unsignedStakingActiveTx ) ;
3843 should . equal ( tx . id , testData . rawTx . unsignedStakingActiveTxHash ) ;
3944 } ) ;
@@ -50,7 +55,11 @@ describe('ADA Staking Activate Transaction Builder', async () => {
5055 'addr1q8rm9z7w4yx5gz652kn2q238efvms6t0qelur9nlglun8eu4tr5knj4fu4adelzqhxg8adu5xca4jra0gtllfrpcawyq9psz23' ,
5156 totalInput
5257 ) ;
53- txBuilder . stakingCredential ( keyPairStake . getKeys ( ) . pub , '7a623c48348501c2380e60ac2307fcd1b67df4218f819930821a15b3' ) ;
58+ txBuilder . stakingCredential (
59+ keyPairStake . getKeys ( ) . pub ,
60+ '7a623c48348501c2380e60ac2307fcd1b67df4218f819930821a15b3' ,
61+ 'always-abstain'
62+ ) ;
5463 txBuilder . ttl ( 800000000 ) ;
5564 const tx = ( await txBuilder . build ( ) ) as Transaction ;
5665 should . equal ( tx . type , TransactionType . StakingActivate ) ;
@@ -129,7 +138,11 @@ describe('ADA Staking Activate Transaction Builder', async () => {
129138 const txBuilder = factory . getStakingActivateBuilder ( ) ;
130139 const senderBalance = '22122071' ;
131140 txBuilder . changeAddress ( senderAddress , senderBalance ) ;
132- txBuilder . stakingCredential ( keyPairStake . getKeys ( ) . pub , '7a623c48348501c2380e60ac2307fcd1b67df4218f819930821a15b3' ) ;
141+ txBuilder . stakingCredential (
142+ keyPairStake . getKeys ( ) . pub ,
143+ '7a623c48348501c2380e60ac2307fcd1b67df4218f819930821a15b3' ,
144+ 'always-no-confidence'
145+ ) ;
133146
134147 txBuilder . input ( {
135148 transaction_id : '0a4f80d83ba9ce1f83306a79252909241308d7eff317d04c9ea018966d687fe3' ,
@@ -172,7 +185,11 @@ describe('ADA Staking Activate Transaction Builder', async () => {
172185 const txBuilder = factory . getStakingActivateBuilder ( ) ;
173186 const senderBalance = '22122071' ;
174187 txBuilder . changeAddress ( senderAddress , senderBalance ) ;
175- txBuilder . stakingCredential ( keyPairStake . getKeys ( ) . pub , '7a623c48348501c2380e60ac2307fcd1b67df4218f819930821a15b3' ) ;
188+ txBuilder . stakingCredential (
189+ keyPairStake . getKeys ( ) . pub ,
190+ '7a623c48348501c2380e60ac2307fcd1b67df4218f819930821a15b3' ,
191+ 'always-no-confidence'
192+ ) ;
176193
177194 txBuilder . input ( {
178195 transaction_id : '0a4f80d83ba9ce1f83306a79252909241308d7eff317d04c9ea018966d687fe3' ,
0 commit comments