Skip to content
This repository has been archived by the owner on Jun 10, 2024. It is now read-only.

Commit

Permalink
fix bug with noFail
Browse files Browse the repository at this point in the history
  • Loading branch information
Abdul-Harisu Inusah committed Sep 8, 2023
1 parent 8d35c40 commit 5631a20
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tzpro/index/op.go
Original file line number Diff line number Diff line change
Expand Up @@ -227,12 +227,12 @@ func (o Op) DecodeParams(noFail bool, onError int) (*ContractParameters, error)
switch o.Parameters[0] {
case '"':
buf, err := hex.DecodeString(string(o.Parameters[1 : len(o.Parameters)-1]))
if err != nil && noFail {
if err != nil && !noFail {
return nil, err
}
params := &Parameters{}
err = params.UnmarshalBinary(buf)
if err != nil && noFail {
if err != nil && !noFail {
return nil, err
}
if o.param.IsValid() {
Expand All @@ -246,7 +246,7 @@ func (o Op) DecodeParams(noFail bool, onError int) (*ContractParameters, error)
val := NewValue(typ, prim)
val.Render = onError
cp.ContractValue.Value, err = val.Map()
if err != nil && noFail {
if err != nil && !noFail {
return nil, fmt.Errorf("op %s (%d) decoding params %s: %v", o.Hash, o.Id, string(o.Parameters), err)
}
return cp, nil
Expand Down

0 comments on commit 5631a20

Please sign in to comment.