Skip to content

Commit

Permalink
fix: error handling
Browse files Browse the repository at this point in the history
  • Loading branch information
JulianToledano committed Mar 7, 2024
1 parent 48381e4 commit abb8e49
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions converter.go
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ func (c converter) UnsignedTx(ops []*rosettatypes.Operation) (tx authsigning.Tx,

signers, _, err := c.cdc.GetMsgV1Signers(msg)
if err != nil {
return nil, err
return nil, crgerrs.WrapError(crgerrs.ErrConverter, fmt.Sprintf("while getting msg signers %s", err.Error()))
}

// check if there are enough signers
Expand Down Expand Up @@ -243,12 +243,15 @@ func (c converter) Ops(status string, msg sdk.Msg) ([]*rosettatypes.Operation, e

signers, _, err := c.cdc.GetMsgV1Signers(msg)
if err != nil {
return nil, err
return nil, crgerrs.WrapError(crgerrs.ErrConverter, fmt.Sprintf("while getting msg signers in Ops %s", err.Error()))
}

ops := make([]*rosettatypes.Operation, len(signers))
for i, signer := range signers {
addr, _ := c.cdc.InterfaceRegistry().SigningContext().AddressCodec().BytesToString(signer)
addr, err := c.ir.SigningContext().AddressCodec().BytesToString(signer)
if err != nil {
return nil, crgerrs.WrapError(crgerrs.ErrConverter, fmt.Sprintf("while getting address from signer %s", err.Error()))
}
op := &rosettatypes.Operation{
Type: sdk.MsgTypeURL(msg),
Status: &status,
Expand Down

0 comments on commit abb8e49

Please sign in to comment.