@@ -104,6 +104,10 @@ func (t *Transaction) SetID(id []byte) {
104104 t .id = id
105105}
106106
107+ func (t * Transaction ) SetSignature (signature []byte ) {
108+ t .signature = signature
109+ }
110+
107111// Signature returns the signature of the transaction
108112func (t * Transaction ) Signature () string {
109113 return utils .EncodeToBase64 (t .signature )
@@ -114,7 +118,7 @@ func (t *Transaction) Signature() string {
114118// the signature
115119func (t * Transaction ) Sign (w arweave.WalletSigner ) (* Transaction , error ) {
116120 // format the message
117- payload , err := t .formatMsgBytes ()
121+ payload , err := t .FormatMsgBytes ()
118122 if err != nil {
119123 return nil , err
120124 }
@@ -192,11 +196,11 @@ func (t *Transaction) UnmarshalJSON(input []byte) error {
192196 return nil
193197}
194198
195- // formatMsgBytes formats the message that needs to be signed. All fields
199+ // FormatMsgBytes formats the message that needs to be signed. All fields
196200// need to be an array of bytes originating from the necessary data (not base64url encoded).
197201// The signing message is the SHA256 of the concatenation of the byte arrays
198202// of the owner public key, target address, data, quantity, reward and last transaction
199- func (t * Transaction ) formatMsgBytes () ([]byte , error ) {
203+ func (t * Transaction ) FormatMsgBytes () ([]byte , error ) {
200204 var msg []byte
201205 lastTx , err := utils .DecodeString (t .LastTx ())
202206 if err != nil {
0 commit comments