@@ -659,8 +659,11 @@ describe('TSS Ecdsa Utils:', async function () {
659
659
transactions : [
660
660
{
661
661
unsignedTx : {
662
- serializedTxHex : 'TOO MANY SECRETS' ,
663
- signableHex : 'TOO MANY SECRETS' ,
662
+ // hteth txid: 0xc5a7bfe6b13ceae563da0f9feaa9c4ad1c101a15366a2a488828a5dd27cb9da3
663
+ serializedTxHex :
664
+ '02f38242688084448b9b8084448b9b908301637894a1cfb9d51c0af191ff21c5f0f01723e056f7dc12865af3107a400080c0808080' ,
665
+ signableHex :
666
+ '02f08242688084448b9b8084448b9b908301637894a1cfb9d51c0af191ff21c5f0f01723e056f7dc12865af3107a400080c0' ,
664
667
derivationPath : '' , // Needs this when key derivation is supported
665
668
} ,
666
669
state : 'pendingSignature' ,
@@ -669,8 +672,11 @@ describe('TSS Ecdsa Utils:', async function () {
669
672
] ,
670
673
unsignedTxs : [
671
674
{
672
- serializedTxHex : 'TOO MANY SECRETS' ,
673
- signableHex : 'TOO MANY SECRETS' ,
675
+ // hteth txid: 0xc5a7bfe6b13ceae563da0f9feaa9c4ad1c101a15366a2a488828a5dd27cb9da3
676
+ serializedTxHex :
677
+ '02f38242688084448b9b8084448b9b908301637894a1cfb9d51c0af191ff21c5f0f01723e056f7dc12865af3107a400080c0808080' ,
678
+ signableHex :
679
+ '02f38242688084448b9b8084448b9b908301637894a1cfb9d51c0af191ff21c5f0f01723e056f7dc12865af3107a400080c0808080' ,
674
680
derivationPath : '' , // Needs this when key derivation is supported
675
681
} ,
676
682
] ,
@@ -933,6 +939,41 @@ describe('TSS Ecdsa Utils:', async function () {
933
939
userGpgActual . should . startWith ( '-----BEGIN PGP PUBLIC KEY BLOCK-----' ) ;
934
940
} ) ;
935
941
942
+ it ( 'signTxRequest should fail with wrong recipient' , async function ( ) {
943
+ await setupSignTxRequestNocks ( true , userSignShare , aShare , dShare , enterpriseData ) ;
944
+ await tssUtils
945
+ . signTxRequest ( {
946
+ txRequest : txRequestId ,
947
+ prv : JSON . stringify ( {
948
+ pShare : userKeyShare . pShare ,
949
+ bitgoNShare : bitgoKeyShare . nShares [ 1 ] ,
950
+ backupNShare : backupKeyShare . nShares [ 1 ] ,
951
+ } ) ,
952
+ reqId,
953
+ txParams : { recipients : [ { address : '0x1234' , amount : '100000000000000' } ] , type : 'transfer' } ,
954
+ } )
955
+ . should . be . rejectedWith ( 'destination address does not match with the recipient address' ) ;
956
+ } ) ;
957
+
958
+ it ( 'signTxRequest should fail with incorrect value' , async function ( ) {
959
+ await setupSignTxRequestNocks ( true , userSignShare , aShare , dShare , enterpriseData ) ;
960
+ await tssUtils
961
+ . signTxRequest ( {
962
+ txRequest : txRequestId ,
963
+ prv : JSON . stringify ( {
964
+ pShare : userKeyShare . pShare ,
965
+ bitgoNShare : bitgoKeyShare . nShares [ 1 ] ,
966
+ backupNShare : backupKeyShare . nShares [ 1 ] ,
967
+ } ) ,
968
+ reqId,
969
+ txParams : {
970
+ recipients : [ { address : '0xa1cfb9d51c0af191ff21c5f0f01723e056f7dc12' , amount : '1' } ] ,
971
+ type : 'transfer' ,
972
+ } ,
973
+ } )
974
+ . should . be . rejectedWith ( 'the transaction amount in txPrebuild does not match the value given by client' ) ;
975
+ } ) ;
976
+
936
977
it ( 'getOfflineSignerPaillierModulus should succeed' , async function ( ) {
937
978
const paillierModulus = tssUtils . getOfflineSignerPaillierModulus ( {
938
979
prv : JSON . stringify ( {
0 commit comments