improved error handling

Signed-off-by: Jürgen Eckel <juergen@riddleandcode.com>
This commit is contained in:
Jürgen Eckel 2023-10-10 02:14:05 +02:00
parent 5adaab3b14
commit 6e3d5ec394
No known key found for this signature in database
2 changed files with 6 additions and 3 deletions

View File

@ -34,8 +34,10 @@ func ReissueAsset(reissue_tx string) (txid string, err error) {
err = errors.New("reissuance of RDDL failed")
} else {
var txobj ReissueResult
json.Unmarshal(stdout.Bytes(), &txobj)
txid = txobj.Txid
err = json.Unmarshal(stdout.Bytes(), &txobj)
if err == nil {
txid = txobj.Txid
}
}
return txid, err
}

View File

@ -18,7 +18,8 @@ func (k msgServer) ReissueRDDLProposal(goCtx context.Context, msg *types.MsgReis
txID, err := util.ReissueAsset(msg.Tx)
if err == nil {
// 3. notarize result by notarizing the liquid tx-id
util.SendRDDLReissuanceResult(ctx, msg.GetProposer(), txID, msg.GetBlockheight())
_ = util.SendRDDLReissuanceResult(ctx, msg.GetProposer(), txID, msg.GetBlockheight())
//TODO verify and resolve error
}
//TODO: reissuance need to be initiated otherwise
}