Skip to content

Commit

Permalink
fix review tips
Browse files Browse the repository at this point in the history
  • Loading branch information
fynn-0xc committed Feb 28, 2023
1 parent 9f4168f commit 537612f
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -232,5 +232,5 @@ replace (
github.com/confio/ics23/go => github.com/cosmos/cosmos-sdk/ics23/go v0.8.0
github.com/cosmos/cosmos-sdk => github.com/bnb-chain/greenfield-cosmos-sdk v0.0.2-0.20230228075616-68ac309b432c
github.com/gogo/protobuf => github.com/regen-network/protobuf v1.3.3-alpha.regen.1
github.com/tendermint/tendermint => github.com/bnb-chain/gnfd-tendermint v0.0.2
github.com/tendermint/tendermint => github.com/bnb-chain/greenfield-tendermint v0.0.2
)
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -216,12 +216,12 @@ github.com/blang/semver v3.5.1+incompatible h1:cQNTCjp13qL8KC3Nbxr/y2Bqb63oX6wdn
github.com/blang/semver v3.5.1+incompatible/go.mod h1:kRBLl5iJ+tD4TcOOxsy/0fnwebNt5EWlYSAyrTnjyyk=
github.com/bmizerany/assert v0.0.0-20160611221934-b7ed37b82869/go.mod h1:Ekp36dRnpXw/yCqJaO+ZrUyxD+3VXMFFr56k5XYrpB4=
github.com/bmizerany/pat v0.0.0-20170815010413-6226ea591a40/go.mod h1:8rLXio+WjiTceGBHIoTvn60HIbs7Hm7bcHjyrSqYB9c=
github.com/bnb-chain/gnfd-tendermint v0.0.2 h1:2Oy7B5A7W/55teZNhlrFR9SamYNjCXAQNjwsbt534jM=
github.com/bnb-chain/gnfd-tendermint v0.0.2/go.mod h1:/v9z9F6cq0+f7EGG92lYSLBcPYQDILoK91X8YM28hWo=
github.com/bnb-chain/greenfield-cosmos-sdk v0.0.2-0.20230228075616-68ac309b432c h1:+YSuQalvzdJbJIDlsIR6oaSewU9KUbY/TGGJn5ktjIE=
github.com/bnb-chain/greenfield-cosmos-sdk v0.0.2-0.20230228075616-68ac309b432c/go.mod h1:FrFE0FmMfUYySW5GdlV45b02SYUkNguECpVdZcUJVuU=
github.com/bnb-chain/greenfield-cosmos-sdk/math v0.0.0-20230228075616-68ac309b432c h1:BLmdYaj7Dx0YOhfk77+KPPJSMCwpQl6f4Y30+801bf0=
github.com/bnb-chain/greenfield-cosmos-sdk/math v0.0.0-20230228075616-68ac309b432c/go.mod h1:u/MXvf8wbUbCsAEyQSSYXXMsczAsFX48e2D6JI86T4o=
github.com/bnb-chain/greenfield-tendermint v0.0.2 h1:SNb3C9QhYklaLgY6onimLHR42IlB6NQJvQqwmj/1ybM=
github.com/bnb-chain/greenfield-tendermint v0.0.2/go.mod h1:/v9z9F6cq0+f7EGG92lYSLBcPYQDILoK91X8YM28hWo=
github.com/boltdb/bolt v1.3.1/go.mod h1:clJnj/oiGkjum5o1McbSZDSLxVThjynRyGBgiAx27Ps=
github.com/bradfitz/go-smtpd v0.0.0-20170404230938-deb6d6237625/go.mod h1:HYsPBTaaSFSlLx/70C2HPIMNZpVV8+vt/A+FMnYP11g=
github.com/bradfitz/gomemcache v0.0.0-20170208213004-1952afaa557d/go.mod h1:PmM6Mmwb0LSuEubjR8N7PtNe1KxZLtOUHtbeikc5h60=
Expand Down
2 changes: 1 addition & 1 deletion x/sp/keeper/sp.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"github.com/bnb-chain/greenfield/x/sp/types"
)

func (k Keeper) CheckIfValidStorageProvider(ctx sdk.Context, addr sdk.AccAddress) error {
func (k Keeper) IsStorageProviderExistAndInService(ctx sdk.Context, addr sdk.AccAddress) error {
store := ctx.KVStore(k.storeKey)

value := store.Get(types.GetStorageProviderKey(addr))
Expand Down
2 changes: 1 addition & 1 deletion x/storage/keeper/keeper.go
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ func (k Keeper) CreateObject(
if err != nil {
return math.ZeroUint(), err
}
err = k.spKeeper.CheckIfValidStorageProvider(ctx, spAcc)
err = k.spKeeper.IsStorageProviderExistAndInService(ctx, spAcc)
if err != nil {
return math.ZeroUint(), err
}
Expand Down
2 changes: 1 addition & 1 deletion x/storage/types/expected_keepers.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ type BankKeeper interface {
type SpKeeper interface {
GetStorageProvider(ctx sdk.Context, addr sdk.AccAddress) (sp sptypes.StorageProvider, found bool)
GetStorageProviderBySealAddr(ctx sdk.Context, sealAddr sdk.AccAddress) (sp sptypes.StorageProvider, found bool)
CheckIfValidStorageProvider(ctx sdk.Context, addr sdk.AccAddress) error
IsStorageProviderExistAndInService(ctx sdk.Context, addr sdk.AccAddress) error
}

type PaymentKeeper interface {
Expand Down

0 comments on commit 537612f

Please sign in to comment.