@@ -76,6 +76,37 @@ describe('/construction/combine', () => {
7676 assert . ok ( body . signed_transaction . length >= unsignedTx . length ) ;
7777 } ) ;
7878
79+ test ( 'combines unsigned transaction when signing payload address is omitted' , async ( ) => {
80+ // Sign the sighash offline
81+ const signature = addHexPrefix ( signWithKey ( SENDER_PRIVATE_KEY , removeHexPrefix ( sighash ) ) ) ;
82+
83+ const res = await post ( fastify , '/construction/combine' , {
84+ network_identifier : NETWORK_IDENTIFIER ,
85+ unsigned_transaction : unsignedTx ,
86+ signatures : [
87+ {
88+ signing_payload : {
89+ hex_bytes : sighash ,
90+ account_identifier : {
91+ address : senderAddress ,
92+ } ,
93+ signature_type : 'ecdsa_recovery' ,
94+ } ,
95+ public_key : {
96+ hex_bytes : senderPublicKey ,
97+ curve_type : 'secp256k1' ,
98+ } ,
99+ signature_type : 'ecdsa_recovery' ,
100+ hex_bytes : signature ,
101+ } ,
102+ ] ,
103+ } ) ;
104+ assert . equal ( res . statusCode , 200 ) ;
105+ const body = JSON . parse ( res . body ) ;
106+ assert . ok ( body . signed_transaction ) ;
107+ assert . ok ( body . signed_transaction . length >= unsignedTx . length ) ;
108+ } ) ;
109+
79110 test ( 'rejects when no signatures are provided' , async ( ) => {
80111 const res = await post ( fastify , '/construction/combine' , {
81112 network_identifier : NETWORK_IDENTIFIER ,
0 commit comments