Skip to content

Commit e02be85

Browse files
committed
improve error handling
1 parent f4d3e0e commit e02be85

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

bap.go

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ func CreateIdentity(privateKey, idKey string, currentCounter uint32) (*bt.Tx, er
6565
}
6666

6767
// Return the transaction
68-
return returnTx(finalOutput), nil
68+
return returnTx(finalOutput)
6969
}
7070

7171
// CreateAttestation creates an attestation transaction from an id key, signing key, and signing address
@@ -108,15 +108,12 @@ func CreateAttestation(idKey, attestorSigningKey, attributeName,
108108
}
109109

110110
// Return the transaction
111-
return returnTx(finalOutput), nil
111+
return returnTx(finalOutput)
112112
}
113113

114114
// returnTx will add the output and return a new tx
115-
func returnTx(outBytes [][]byte) (t *bt.Tx) {
115+
func returnTx(outBytes [][]byte) (t *bt.Tx, err error) {
116116
t = bt.NewTx()
117-
err := t.AddOpReturnPartsOutput(outBytes)
118-
if err != nil {
119-
return nil
120-
}
117+
err = t.AddOpReturnPartsOutput(outBytes)
121118
return
122119
}

0 commit comments

Comments
 (0)