@@ -15,18 +15,18 @@ describe('ADA Staking Pledge Transaction Builder', async () => {
15
15
const tx = ( await txBuilder . build ( ) ) as Transaction ;
16
16
should . equal ( tx . type , TransactionType . StakingPledge ) ;
17
17
const txData = tx . toJson ( ) ;
18
- txData . inputs . length . should . equal ( 1 ) ;
18
+ txData . inputs . length . should . equal ( 2 ) ;
19
19
txData . outputs . length . should . equal ( 1 ) ;
20
20
txData . certs . length . should . equal ( 2 ) ;
21
21
txData . certs [ 0 ] . type . should . equal ( 3 ) ;
22
22
txData . certs [ 1 ] . type . should . equal ( 1 ) ;
23
23
should . exist ( txData . certs [ 1 ] . poolKeyHash ) ;
24
- txData . certs [ 0 ] . poolKeyHash ! . should . equal ( '76044d3aa9caafbb213ae45f9a3f5ad3cc6c836f375ebbcfa5c83681 ' ) ;
24
+ txData . certs [ 0 ] . poolKeyHash ! . should . equal ( '10324dc34187735de46f6260d94620cdcc819f7ed1f93e3fc58d06a0 ' ) ;
25
25
txData . withdrawals . length . should . equal ( 0 ) ;
26
26
txData . witnesses . length . should . equal ( 0 ) ;
27
27
28
28
const fee = tx . getFee ;
29
- fee . should . equal ( '185609 ' ) ;
29
+ fee . should . equal ( '1000000 ' ) ;
30
30
tx . toBroadcastFormat ( ) . should . equal ( rawTx . unsignedNewPledgeTx ) ;
31
31
should . equal ( tx . id , rawTx . unsignedNewPledgeTxHash ) ;
32
32
@@ -42,17 +42,17 @@ describe('ADA Staking Pledge Transaction Builder', async () => {
42
42
const tx = ( await txBuilder . build ( ) ) as Transaction ;
43
43
should . equal ( tx . type , TransactionType . StakingPledge ) ;
44
44
const txData = tx . toJson ( ) ;
45
- txData . inputs . length . should . equal ( 1 ) ;
45
+ txData . inputs . length . should . equal ( 2 ) ;
46
46
txData . outputs . length . should . equal ( 1 ) ;
47
47
txData . certs . length . should . equal ( 1 ) ;
48
48
txData . certs [ 0 ] . type . should . equal ( 3 ) ;
49
49
should . exist ( txData . certs [ 0 ] . poolKeyHash ) ;
50
- txData . certs [ 0 ] . poolKeyHash ! . should . equal ( 'f61c42cbf7c8c53af3f520508212ad3e72f674f957fe23ff0acb4973 ' ) ;
50
+ txData . certs [ 0 ] . poolKeyHash ! . should . equal ( '10324dc34187735de46f6260d94620cdcc819f7ed1f93e3fc58d06a0 ' ) ;
51
51
txData . withdrawals . length . should . equal ( 0 ) ;
52
52
txData . witnesses . length . should . equal ( 0 ) ;
53
53
54
54
const fee = tx . getFee ;
55
- fee . should . equal ( '42 ' ) ;
55
+ fee . should . equal ( '1000000 ' ) ;
56
56
tx . toBroadcastFormat ( ) . should . equal ( rawTx . unsignedUpdatePledgeTx ) ;
57
57
should . equal ( tx . id , rawTx . unsignedUpdatePledgeTxHash ) ;
58
58
@@ -67,7 +67,14 @@ describe('ADA Staking Pledge Transaction Builder', async () => {
67
67
txBuilder . initBuilder ( prebuiltTx ) ;
68
68
txBuilder . addNodeKeyWitness ( rawTx . pledgeNodeKeyPubkey , rawTx . pledgeNodeWitnessSignature ) ;
69
69
const tx = ( await txBuilder . build ( ) ) as Transaction ;
70
+ tx . signature . length . should . equal ( 1 ) ;
70
71
const txData = tx . toJson ( ) ;
71
72
txData . witnesses . length . should . equal ( 1 ) ;
73
+
74
+ const rebuiltTx = new Transaction ( coins . get ( 'tada' ) ) ;
75
+ rebuiltTx . fromRawTransaction ( tx . toBroadcastFormat ( ) ) ;
76
+ rebuiltTx . signature . length . should . equal ( 1 ) ;
77
+ rebuiltTx . toBroadcastFormat ( ) . should . equal ( tx . toBroadcastFormat ( ) ) ;
78
+ rebuiltTx . toBroadcastFormat ( ) . should . not . equal ( rawTx . unsignedUpdatePledgeTx ) ;
72
79
} ) ;
73
80
} ) ;
0 commit comments