1
1
import { AsyncKeyAgent , SignBlobResult , Witnesser , util } from '../../src' ;
2
- import { Cardano } from '@cardano-sdk/core' ;
2
+ import { Cardano , Serialization } from '@cardano-sdk/core' ;
3
3
import { HexBlob } from '@cardano-sdk/util' ;
4
4
5
5
describe ( 'createBip32Ed25519Witnesser' , ( ) => {
@@ -24,14 +24,20 @@ describe('createBip32Ed25519Witnesser', () => {
24
24
} ) ;
25
25
26
26
it ( 'signTransaction is unchanged' , async ( ) => {
27
+ const transaction = new Serialization . Transaction (
28
+ Serialization . TransactionBody . fromCore ( { fee : 20_000n , inputs : [ ] , outputs : [ ] , validityInterval : { } } ) ,
29
+ new Serialization . TransactionWitnessSet ( )
30
+ ) ;
31
+
27
32
const txInternals = {
28
- body : { fee : 20_000n , inputs : [ ] , outputs : [ ] , validityInterval : { } } as Cardano . HydratedTxBody ,
29
- hash : Cardano . TransactionId ( '8561258e210352fba2ac0488afed67b3427a27ccf1d41ec030c98a8199bc22ec ' )
33
+ body : transaction . body ( ) . toCore ( ) ,
34
+ hash : Cardano . TransactionId ( '3643bb5fe745ba0532977f82ecf54699963c97adef2626f7c780225d218e9ba6 ' )
30
35
} ;
36
+
31
37
const options = { knownAddresses : [ ] , txInKeyPathMap : { } } ;
32
38
const result = { } as Cardano . Signatures ;
33
39
asyncKeyAgent . signTransaction . mockResolvedValueOnce ( result ) ;
34
- await expect ( witnesser . witness ( txInternals , options ) ) . resolves . toEqual ( { signatures : result } ) ;
40
+ await expect ( witnesser . witness ( transaction , options ) ) . resolves . toEqual ( { signatures : result } ) ;
35
41
expect ( asyncKeyAgent . signTransaction ) . toBeCalledWith ( txInternals , options , void 0 ) ;
36
42
} ) ;
37
43
} ) ;
0 commit comments