Skip to content

Commit

Permalink
fix: move error to api scope
Browse files Browse the repository at this point in the history
  • Loading branch information
moraleinside committed Dec 1, 2022
1 parent 1046279 commit f64c61a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion rpcapi/api/contract_v2.go
Original file line number Diff line number Diff line change
Expand Up @@ -438,7 +438,7 @@ func (r *ContractApi) GetSBPRewardPendingWithdrawal(name string) (*SBPReward, er
return nil, err
}
if info == nil {
return nil, nil
return nil, util.ErrSBPNotExists
}
sb, err := db.LatestSnapshotBlock()
if err != nil {
Expand Down Expand Up @@ -507,6 +507,9 @@ func (r *ContractApi) GetSBP(name string) (*SBPInfo, error) {
if err != nil {
return nil, err
}
if info == nil {
return nil, util.ErrSBPNotExists
}
sb, err := db.LatestSnapshotBlock()
if err != nil {
return nil, err
Expand Down
2 changes: 1 addition & 1 deletion vm/contracts/abi/abi_gonvernance.go
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,7 @@ func GetRegistration(db StorageDatabase, gid types.Gid, name string) (*types.Reg
return nil, err
}
if len(value) == 0 {
return nil, util.ErrSBPNotExists
return nil, nil
}

return UnpackRegistration(value)
Expand Down

0 comments on commit f64c61a

Please sign in to comment.