@@ -659,8 +659,11 @@ describe('TSS Ecdsa Utils:', async function () {
659659 transactions : [
660660 {
661661 unsignedTx : {
662- serializedTxHex : 'TOO MANY SECRETS' ,
663- signableHex : 'TOO MANY SECRETS' ,
662+ // hteth txid: 0xc5a7bfe6b13ceae563da0f9feaa9c4ad1c101a15366a2a488828a5dd27cb9da3
663+ serializedTxHex :
664+ '02f38242688084448b9b8084448b9b908301637894a1cfb9d51c0af191ff21c5f0f01723e056f7dc12865af3107a400080c0808080' ,
665+ signableHex :
666+ '02f08242688084448b9b8084448b9b908301637894a1cfb9d51c0af191ff21c5f0f01723e056f7dc12865af3107a400080c0' ,
664667 derivationPath : '' , // Needs this when key derivation is supported
665668 } ,
666669 state : 'pendingSignature' ,
@@ -669,8 +672,11 @@ describe('TSS Ecdsa Utils:', async function () {
669672 ] ,
670673 unsignedTxs : [
671674 {
672- serializedTxHex : 'TOO MANY SECRETS' ,
673- signableHex : 'TOO MANY SECRETS' ,
675+ // hteth txid: 0xc5a7bfe6b13ceae563da0f9feaa9c4ad1c101a15366a2a488828a5dd27cb9da3
676+ serializedTxHex :
677+ '02f38242688084448b9b8084448b9b908301637894a1cfb9d51c0af191ff21c5f0f01723e056f7dc12865af3107a400080c0808080' ,
678+ signableHex :
679+ '02f38242688084448b9b8084448b9b908301637894a1cfb9d51c0af191ff21c5f0f01723e056f7dc12865af3107a400080c0808080' ,
674680 derivationPath : '' , // Needs this when key derivation is supported
675681 } ,
676682 ] ,
@@ -933,6 +939,41 @@ describe('TSS Ecdsa Utils:', async function () {
933939 userGpgActual . should . startWith ( '-----BEGIN PGP PUBLIC KEY BLOCK-----' ) ;
934940 } ) ;
935941
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+
936977 it ( 'getOfflineSignerPaillierModulus should succeed' , async function ( ) {
937978 const paillierModulus = tssUtils . getOfflineSignerPaillierModulus ( {
938979 prv : JSON . stringify ( {
0 commit comments