Skip to content

Commit

Permalink
change address verifier to wasmtypes
Browse files Browse the repository at this point in the history
  • Loading branch information
yun-yeo committed May 21, 2022
1 parent c9cd8f9 commit b88f75a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 11 deletions.
10 changes: 0 additions & 10 deletions app/app.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package app

import (
"fmt"
"io"
"net/http"
"os"
Expand Down Expand Up @@ -143,15 +142,6 @@ var (
// of "EnableAllProposals" (takes precedence over ProposalsEnabled)
// https://github.com/CosmWasm/wasmd/blob/02a54d33ff2c064f3539ae12d75d027d9c665f05/x/wasm/internal/types/proposal.go#L28-L34
EnableSpecificProposals = ""

// AddressVerifier terra address verifier
AddressVerifier = func(bz []byte) error {
if n := len(bz); n != 20 {
return fmt.Errorf("incorrect address length %d", n)
}

return nil
}
)

// GetEnabledProposals parses the ProposalsEnabled / EnableSpecificProposals values to
Expand Down
3 changes: 2 additions & 1 deletion cmd/terrad/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import (
"github.com/tendermint/tendermint/libs/log"
dbm "github.com/tendermint/tm-db"

wasmtypes "github.com/CosmWasm/wasmd/x/wasm/types"
"github.com/cosmos/cosmos-sdk/baseapp"
"github.com/cosmos/cosmos-sdk/client"
"github.com/cosmos/cosmos-sdk/client/config"
Expand Down Expand Up @@ -56,7 +57,7 @@ func NewRootCmd() (*cobra.Command, params.EncodingConfig) {
sdkConfig.SetBech32PrefixForAccount(terraapp.AccountAddressPrefix, accountPubKeyPrefix)
sdkConfig.SetBech32PrefixForValidator(validatorAddressPrefix, validatorPubKeyPrefix)
sdkConfig.SetBech32PrefixForConsensusNode(consNodeAddressPrefix, consNodePubKeyPrefix)
sdkConfig.SetAddressVerifier(terraapp.AddressVerifier)
sdkConfig.SetAddressVerifier(wasmtypes.VerifyAddressLen())
sdkConfig.Seal()

initClientCtx := client.Context{}.
Expand Down

0 comments on commit b88f75a

Please sign in to comment.