Skip to content

Commit

Permalink
Fix incorrect error return.
Browse files Browse the repository at this point in the history
  • Loading branch information
nickeskov committed Mar 7, 2025
1 parent 4e0afe2 commit c585865
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion pkg/state/block_differ.go
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ func (d *blockDiffer) createMinerAndRewardDiff(
return txDiff{}, err
}
if mpErr := d.doMinerPayoutBeforeNG(minerDiff, blockHeader.Timestamp, minerAddr, transactions); mpErr != nil {
return txDiff{}, errors.Wrap(err, "failed to count miner payout")
return txDiff{}, errors.Wrap(mpErr, "failed to count miner payout")
}
d.appendBlockInfoToTxDiff(minerDiff, blockHeader)
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/state/invoke_applier.go
Original file line number Diff line number Diff line change
Expand Up @@ -518,7 +518,7 @@ func (ia *invokeApplier) fallibleValidation(tx proto.Transaction, info *addlInvo
}
if nftErr := ai.initIsNFTFlag(ia.stor.features); nftErr != nil {
return proto.DAppError, info.failedChanges,
errors.Wrapf(err, "failed to initialize isNFT flag for asset %s", a.ID.String())
errors.Wrapf(nftErr, "failed to initialize isNFT flag for asset %s", a.ID.String())
}

id := proto.AssetIDFromDigest(a.ID)
Expand Down
4 changes: 2 additions & 2 deletions pkg/state/transaction_checker.go
Original file line number Diff line number Diff line change
Expand Up @@ -859,10 +859,10 @@ func (tc *transactionChecker) checkExchange(transaction proto.Transaction, info
return nil, err
}
if errO1 := checkOrderWithMetamaskFeature(o1, metamaskActivated); errO1 != nil {
return nil, errors.Wrap(err, "order1 metamask feature checks failed")
return nil, errors.Wrap(errO1, "order1 metamask feature checks failed")
}
if errO2 := checkOrderWithMetamaskFeature(o2, metamaskActivated); errO2 != nil {
return nil, errors.Wrap(err, "order2 metamask feature checks failed")
return nil, errors.Wrap(errO2, "order2 metamask feature checks failed")
}

// Check assets.
Expand Down

0 comments on commit c585865

Please sign in to comment.