Skip to content

Commit

Permalink
chore: change some minor things that haven't been fixed in #549 (#635)
Browse files Browse the repository at this point in the history
* fix: wrong protoname in vesting

Signed-off-by: zemyblue <zemyblue@gmail.com>

* fix: wrong protoname in authz

Signed-off-by: zemyblue <zemyblue@gmail.com>

* chore: change migration property name to be same with cosmos-sdk

Signed-off-by: zemyblue <zemyblue@gmail.com>

* chore: remove unused function

Signed-off-by: zemyblue <zemyblue@gmail.com>

* docs: update changelog

Signed-off-by: zemyblue <zemyblue@gmail.com>

* chore: change `Keeper.space` type to be same with cosmos-sdk

Signed-off-by: zemyblue <zemyblue@gmail.com>

* chore: add unittest

Signed-off-by: zemyblue <zemyblue@gmail.com>

* Update CHANGELOG.md

change changelog

Signed-off-by: zemyblue <zemyblue@gmail.com>
  • Loading branch information
zemyblue committed Aug 16, 2022
1 parent 56799e7 commit 8679ec2
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 21 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ Ref: https://keepachangelog.com/en/1.0.0/
* (client) [\#565](https://github.com/line/lbm-sdk/pull/565) fix the data race problem in `TestQueryABCIHeight`
* (x/token) [\#589](https://github.com/line/lbm-sdk/pull/589) fix naming collision in x/token enums
* (x/token) [\#599](https://github.com/line/lbm-sdk/pull/599) fix the order of events
* (amino) [\#635](https://github.com/line/lbm-sdk/pull/635) change some minor things that haven't been fixed in #549

### Breaking Changes
* (proto) [\#564](https://github.com/line/lbm-sdk/pull/564) change gRPC path to original cosmos path
Expand Down
2 changes: 1 addition & 1 deletion x/auth/vesting/types/codec.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ func RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) {
// Interfaces and creates a registry of it's concrete implementations
func RegisterInterfaces(registry types.InterfaceRegistry) {
registry.RegisterInterface(
"lbm.vesting.v1.VestingAccount",
"cosmos.vesting.v1beta1.VestingAccount",
(*exported.VestingAccount)(nil),
&ContinuousVestingAccount{},
&DelayedVestingAccount{},
Expand Down
2 changes: 1 addition & 1 deletion x/authz/codec.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ func RegisterInterfaces(registry types.InterfaceRegistry) {
)

registry.RegisterInterface(
"lbm.v1.Authorization",
"cosmos.v1beta1.Authorization",
(*Authorization)(nil),
&GenericAuthorization{},
)
Expand Down
10 changes: 0 additions & 10 deletions x/bank/keeper/send.go
Original file line number Diff line number Diff line change
Expand Up @@ -288,13 +288,3 @@ func (k BaseSendKeeper) IsSendEnabledCoin(ctx sdk.Context, coin sdk.Coin) bool {
func (k BaseSendKeeper) BlockedAddr(addr sdk.AccAddress) bool {
return k.blockedAddrs[addr.String()]
}

func (k BaseSendKeeper) ChangeBlockedAddrState(addr sdk.AccAddress, isBlocked bool) error {
key := addr.String()
if _, ok := k.blockedAddrs[key]; !ok {
return sdkerrors.Wrapf(types.ErrInvalidKey, "%s is not in blockedAddrs", key)
}

k.blockedAddrs[key] = isBlocked
return nil
}
13 changes: 7 additions & 6 deletions x/genutil/client/cli/migrate.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"sort"
"time"

ocjson "github.com/line/ostracon/libs/json"
"github.com/pkg/errors"
"github.com/spf13/cobra"

Expand All @@ -18,23 +19,23 @@ import (

const flagGenesisTime = "genesis-time"

// VersionMap allow applications to extend and modify the migration process.
// Allow applications to extend and modify the migration process.
//
// Ref: https://github.com/cosmos/cosmos-sdk/issues/5041
var VersionMap = types.VersionMap{}
var migrationMap = types.MigrationMap{}

// GetMigrationCallback returns a MigrationCallback for a given version.
func GetMigrationCallback(version string) types.MigrationCallback {
return VersionMap[version]
return migrationMap[version]
}

// GetMigrationVersions get all migration version in a sorted slice.
func GetMigrationVersions() []string {
versions := make([]string, len(VersionMap))
versions := make([]string, len(migrationMap))

var i int

for version := range VersionMap {
for version := range migrationMap {
versions[i] = version
i++
}
Expand Down Expand Up @@ -111,7 +112,7 @@ $ %s migrate v0.43 /path/to/genesis.json --chain-id=test-chain-1 --genesis-time=
genDoc.ChainID = chainID
}

bz, err := json.Marshal(genDoc)
bz, err := ocjson.Marshal(genDoc)
if err != nil {
return errors.Wrap(err, "failed to marshal genesis doc")
}
Expand Down
10 changes: 9 additions & 1 deletion x/genutil/client/testutil/migrate.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,15 @@ func (s *IntegrationTestSuite) TestMigrateGenesis() {
expErr bool
expErrMsg string
check func(jsonOut string)
}{}
}{
{
"migrate 0.42 to 0.43(result error)",
v040Valid,
"v0.43",
true, "",
nil,
},
}

for _, tc := range testCases {
tc := tc
Expand Down
4 changes: 2 additions & 2 deletions x/genutil/types/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ type (
// TODO: MigrationCallback should also return an error upon failure.
MigrationCallback func(AppMap, client.Context) AppMap

// VersionMap defines a mapping from a version to a MigrationCallback.
VersionMap map[string]MigrationCallback
// MigrationMap defines a mapping from a version to a MigrationCallback.
MigrationMap map[string]MigrationCallback
)

// ModuleName is genutil
Expand Down

0 comments on commit 8679ec2

Please sign in to comment.