diff --git a/app/types/config.go b/app/types/config.go index 61659cfb63..1f1c28e504 100644 --- a/app/types/config.go +++ b/app/types/config.go @@ -7,7 +7,7 @@ import ( const ( // EthBech32Prefix defines the Bech32 prefix used for EthAccounts - EthBech32Prefix = "okexchain" + EthBech32Prefix = "ex" // Bech32PrefixAccAddr defines the Bech32 prefix of an account's address Bech32PrefixAccAddr = EthBech32Prefix diff --git a/go.mod b/go.mod index ee754d88d6..639c2ca282 100644 --- a/go.mod +++ b/go.mod @@ -50,7 +50,7 @@ require ( ) replace ( - github.com/cosmos/cosmos-sdk => github.com/okex/cosmos-sdk v0.39.2-okexchain3 + github.com/cosmos/cosmos-sdk => github.com/okex/cosmos-sdk v0.39.2-okexchain3.1 github.com/tendermint/iavl => github.com/okex/iavl v0.14.1-okexchain1 github.com/tendermint/tendermint => github.com/okex/tendermint v0.33.9-okexchain1 ) diff --git a/go.sum b/go.sum index 009a3f71f9..b699e44c95 100644 --- a/go.sum +++ b/go.sum @@ -498,6 +498,8 @@ github.com/nxadm/tail v1.4.4 h1:DQuhQpB1tVlglWS2hLQ5OV6B5r8aGxSrPc5Qo6uTN78= github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= github.com/okex/cosmos-sdk v0.39.2-okexchain3 h1:19tx5fM8Eh2uBp768XyUXRSnxjLW+/wUKp9p/AaP2NU= github.com/okex/cosmos-sdk v0.39.2-okexchain3/go.mod h1:Y1C2roqCVZ6gSYG31X77x4NLcbSGS9VP1GIiAE1imcc= +github.com/okex/cosmos-sdk v0.39.2-okexchain3.1 h1:EqamhILf3A7bnOlke44G6yIX0DiqHj9jZKJsFgwYrTo= +github.com/okex/cosmos-sdk v0.39.2-okexchain3.1/go.mod h1:Y1C2roqCVZ6gSYG31X77x4NLcbSGS9VP1GIiAE1imcc= github.com/okex/iavl v0.14.1-okexchain1 h1:aP9Rpxb1QU06WgTJ/xLyEQbZOiZzKy3once7wGtNLIU= github.com/okex/iavl v0.14.1-okexchain1/go.mod h1:QmfViflFiXzxKLQE4tAUuWQHq+RSuQFxablW5oJZ6sE= github.com/okex/tendermint v0.33.9-okexchain1 h1:D/ucsRdls+9fkfmvc9AdrFhSS8gtfzk3jyYt+PSzbEY= diff --git a/x/ammswap/keeper/keeper_test.go b/x/ammswap/keeper/keeper_test.go index cb81fb5081..5218f6ba6d 100644 --- a/x/ammswap/keeper/keeper_test.go +++ b/x/ammswap/keeper/keeper_test.go @@ -10,7 +10,7 @@ import ( abci "github.com/tendermint/tendermint/abci/types" ) -const addrTest = "okexchain1a20d4xmqj4m9shtm0skt0aaahsgeu4h6746fs2" +const addrTest = "ex1rf9wr069pt64e58f2w3mjs9w72g8vemzw26658" func TestKeeper_GetPoolTokenInfo(t *testing.T) { mapp, _ := GetTestInput(t, 1) @@ -88,4 +88,4 @@ func TestGetInputPrice(t *testing.T) { outputAmount := GetInputPrice(inputAmount, inputReserve, outputReserve, feeRate) expectedAmount := sdk.NewDec(0) require.Equal(t, expectedAmount.String(), outputAmount.String()) -} \ No newline at end of file +} diff --git a/x/common/util_test.go b/x/common/util_test.go index a38ef073ac..f569ddd5f3 100644 --- a/x/common/util_test.go +++ b/x/common/util_test.go @@ -5,8 +5,8 @@ import ( "testing" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/stretchr/testify/require" apptypes "github.com/okex/okexchain/app/types" + "github.com/stretchr/testify/require" ) func initConfig() { @@ -18,7 +18,7 @@ func initConfig() { func TestHasSufCoins(t *testing.T) { initConfig() - addr, err := sdk.AccAddressFromBech32("okexchain18mxjm0knqjpkaxk2zd2jr67pgrd8c0ct0tycvl") + addr, err := sdk.AccAddressFromBech32("ex1rf9wr069pt64e58f2w3mjs9w72g8vemzw26658") require.Nil(t, err) availDecCoins, err := sdk.ParseDecCoins(fmt.Sprintf("%d%s,%d%s", @@ -54,7 +54,7 @@ func TestBlackHoleAddress(t *testing.T) { addr := BlackHoleAddress() a := addr.String() fmt.Println(a) - require.Equal(t, addr.String(), "okexchain1qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqupa6dx") + require.Equal(t, addr.String(), "ex1qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqm2k6w2") } func TestGetFixedLengthRandomString(t *testing.T) { diff --git a/x/dex/types/const.go b/x/dex/types/const.go index 26f75ee71e..d7c9789228 100644 --- a/x/dex/types/const.go +++ b/x/dex/types/const.go @@ -2,5 +2,5 @@ package types const ( // TestTokenPairOwner defines owner of token pair, just for test - TestTokenPairOwner = "okexchain10q0rk5qnyag7wfvvt7rtphlw589m7frsku8qc9" + TestTokenPairOwner = "ex1rf9wr069pt64e58f2w3mjs9w72g8vemzw26658" ) diff --git a/x/distribution/client/cli/tx.go b/x/distribution/client/cli/tx.go index e0585d8676..5a07cd4551 100644 --- a/x/distribution/client/cli/tx.go +++ b/x/distribution/client/cli/tx.go @@ -48,7 +48,7 @@ func GetCmdSetWithdrawAddr(cdc *codec.Codec) *cobra.Command { fmt.Sprintf(`Set the withdraw address for rewards associated with a delegator address. Example: -$ %s tx distr set-withdraw-addr okexchain1hw4r48aww06ldrfeuq2v438ujnl6alsz0685a0 --from mykey +$ %s tx distr set-withdraw-addr ex1cftp8q8g4aa65nw9s5trwexe77d9t6cr8ndu02 --from mykey `, version.ClientName, ), @@ -122,7 +122,7 @@ Where proposal.json contains: { "title": "Community Pool Spend", "description": "Pay me some %s!", - "recipient": "okexchain1hw4r48aww06ldrfeuq2v438ujnl6alsz0685a0", + "recipient": "ex1cftp8q8g4aa65nw9s5trwexe77d9t6cr8ndu02", "amount": [ { "denom": "%s", diff --git a/x/farm/client/cli/query.go b/x/farm/client/cli/query.go index 0cab5b81ad..82bd94aa3f 100644 --- a/x/farm/client/cli/query.go +++ b/x/farm/client/cli/query.go @@ -122,7 +122,7 @@ func GetCmdQueryEarnings(storeName string, cdc *codec.Codec) *cobra.Command { fmt.Sprintf(`Query available rewards for an address. Example: -$ %s query farm rewards pool-eth-xxb okexchain1hw4r48aww06ldrfeuq2v438ujnl6alsz0685a0 +$ %s query farm rewards pool-eth-xxb ex1cftp8q8g4aa65nw9s5trwexe77d9t6cr8ndu02 `, version.ClientName, ), @@ -222,7 +222,7 @@ func GetCmdQueryAccount(storeName string, cdc *codec.Codec) *cobra.Command { fmt.Sprintf(`Query the names of all pools that an account has locked coins in. Example: -$ %s query farm account okexchain1hw4r48aww06ldrfeuq2v438ujnl6alsz0685a0 +$ %s query farm account ex1cftp8q8g4aa65nw9s5trwexe77d9t6cr8ndu02 `, version.ClientName, ), @@ -329,7 +329,7 @@ func GetCmdQueryLockInfo(storeName string, cdc *codec.Codec) *cobra.Command { fmt.Sprintf(`Query the lock info of an account's token locking on a specific pool. Example: -$ %s query farm lock-info pool-eth-xxb okexchain1hw4r48aww06ldrfeuq2v438ujnl6alsz0685a0 +$ %s query farm lock-info pool-eth-xxb ex1cftp8q8g4aa65nw9s5trwexe77d9t6cr8ndu02 `, version.ClientName, ), diff --git a/x/farm/handler_test.go b/x/farm/handler_test.go index 14aab7a93e..a7e24517a3 100644 --- a/x/farm/handler_test.go +++ b/x/farm/handler_test.go @@ -357,7 +357,7 @@ func TestHandlerMsgDestroyPool(t *testing.T) { return destroyPoolMsg }, verification: verification, - expectedErr: types.ErrInvalidPoolOwner("okexchain15ky9du8a2wlstz6fpx3p4mqpjyrm5cgpq6kh8f", "abc"), + expectedErr: types.ErrInvalidPoolOwner("ex15ky9du8a2wlstz6fpx3p4mqpjyrm5cgp83ahy9", "abc"), }, { caseName: "failed. insufficient fee coins", @@ -374,7 +374,7 @@ func TestHandlerMsgDestroyPool(t *testing.T) { }, getMsg: normalGetDestroyPoolMsg, verification: verification, - expectedErr: errors.New("insufficient coins: insufficient funds: insufficient account funds; 10.000000000000000000okt < 1.000000000000000000fff"), + expectedErr: errors.New("insufficient coins: insufficient funds: insufficient account funds; 10.000000000000000000okt < 1.000000000000000000fff"), }, { caseName: "failed. the pool is not finished and can not be destroyed", @@ -706,7 +706,7 @@ func TestHandlerMsgUnlock(t *testing.T) { }, getMsg: normalGetUnlockMsg, verification: verification, - expectedErr: types.ErrNoLockInfoFound("okexchain15ky9du8a2wlstz6fpx3p4mqpjyrm5cgqavzz6m", "abc"), + expectedErr: types.ErrNoLockInfoFound("ex15ky9du8a2wlstz6fpx3p4mqpjyrm5cgq68fzeh", "abc"), }, { caseName: "failed. The coin name should be %s, not %s", @@ -807,7 +807,7 @@ func TestHandlerMsgUnlock(t *testing.T) { }, getMsg: normalGetUnlockMsg, verification: verification, - expectedErr: errors.New(fmt.Sprintf("failed. send coins from module to account failed insufficient funds: insufficient account funds; " + "10.000000000000000000%s < 1.000000000000000000ammswap_aab_ccb", sdk.DefaultBondDenom)), + expectedErr: errors.New(fmt.Sprintf("failed. send coins from module to account failed insufficient funds: insufficient account funds; "+"10.000000000000000000%s < 1.000000000000000000ammswap_aab_ccb", sdk.DefaultBondDenom)), }, { caseName: "success. lock and unlock without provide before", diff --git a/x/gov/client/cli/query.go b/x/gov/client/cli/query.go index 7f2e310f97..1af8fb352b 100644 --- a/x/gov/client/cli/query.go +++ b/x/gov/client/cli/query.go @@ -15,8 +15,8 @@ import ( "github.com/cosmos/cosmos-sdk/version" "github.com/okex/okexchain/x/gov/client/utils" - "github.com/okex/okexchain/x/gov/types" "github.com/cosmos/cosmos-sdk/client/flags" + "github.com/okex/okexchain/x/gov/types" ) // GetQueryCmd returns the cli query commands for this module @@ -92,8 +92,8 @@ func GetCmdQueryProposals(queryRoute string, cdc *codec.Codec) *cobra.Command { fmt.Sprintf(`Query for a all proposals. You can filter the returns with the following flags. Example: -$ %s query gov proposals --depositor okexchain1skjwj5whet0lpe65qaq4rpq03hjxlwd9nf39lk -$ %s query gov proposals --voter okexchain1skjwj5whet0lpe65qaq4rpq03hjxlwd9nf39lk +$ %s query gov proposals --depositor ex1rf9wr069pt64e58f2w3mjs9w72g8vemzw26658 +$ %s query gov proposals --voter ex1rf9wr069pt64e58f2w3mjs9w72g8vemzw26658 $ %s query gov proposals --status (DepositPeriod|VotingPeriod|Passed|Rejected) `, version.ClientName, version.ClientName, version.ClientName, @@ -304,7 +304,7 @@ func getCmdQueryVote(queryRoute string, cdc *codec.Codec) *cobra.Command { fmt.Sprintf(`Query details for a single vote on a proposal given its identifier. Example: -$ %s query gov vote 1 okexchain1hw4r48aww06ldrfeuq2v438ujnl6alsz0685a0 +$ %s query gov vote 1 ex1cftp8q8g4aa65nw9s5trwexe77d9t6cr8ndu02 `, version.ClientName, ), @@ -422,7 +422,7 @@ func getCmdQueryDeposit(queryRoute string, cdc *codec.Codec) *cobra.Command { fmt.Sprintf(`Query details for a single proposal deposit on a proposal by its identifier. Example: -$ %s query gov deposit 1 okexchain1skjwj5whet0lpe65qaq4rpq03hjxlwd9nf39lk +$ %s query gov deposit 1 ex1rf9wr069pt64e58f2w3mjs9w72g8vemzw26658 `, version.ClientName, ), diff --git a/x/order/handler_test.go b/x/order/handler_test.go index 9b2ff9021c..1ba46af02e 100644 --- a/x/order/handler_test.go +++ b/x/order/handler_test.go @@ -929,7 +929,7 @@ func TestFeesTable(t *testing.T) { } func handleOrders(t *testing.T, baseasset string, quoteasset string, orders []*types.Order, blockheight int64) sdk.SysCoins { - TestTokenPairOwner := "okexchain10q0rk5qnyag7wfvvt7rtphlw589m7frsku8qc9" + TestTokenPairOwner := "ex1rf9wr069pt64e58f2w3mjs9w72g8vemzw26658" addr, err := sdk.AccAddressFromBech32(TestTokenPairOwner) require.Nil(t, err) mapp, addrKeysSlice := getMockApp(t, len(orders)) diff --git a/x/staking/client/cli/query.go b/x/staking/client/cli/query.go index 8169af5731..87f2308d5e 100644 --- a/x/staking/client/cli/query.go +++ b/x/staking/client/cli/query.go @@ -185,7 +185,7 @@ func GetCmdQueryProxy(storeName string, cdc *codec.Codec) *cobra.Command { fmt.Sprintf(`Query the addresses of delegators by a specific proxy Example: -$ %s query staking proxy okexchain1hw4r48aww06ldrfeuq2v438ujnl6alsz0685a0 +$ %s query staking proxy ex1cftp8q8g4aa65nw9s5trwexe77d9t6cr8ndu02 `, version.ClientName, ), @@ -240,7 +240,7 @@ func GetCmdQueryDelegator(storeName string, cdc *codec.Codec) *cobra.Command { fmt.Sprintf(`Query the information of delegations and all shares recently added by a delegator Example: -$ %s query staking delegator okexchain1hw4r48aww06ldrfeuq2v438ujnl6alsz0685a0 +$ %s query staking delegator ex1cftp8q8g4aa65nw9s5trwexe77d9t6cr8ndu02 `, version.ClientName, ), diff --git a/x/staking/client/cli/tx_vote.go b/x/staking/client/cli/tx_vote.go index 089a904602..dda105be58 100644 --- a/x/staking/client/cli/tx_vote.go +++ b/x/staking/client/cli/tx_vote.go @@ -227,7 +227,7 @@ func GetCmdBindProxy(cdc *codec.Codec) *cobra.Command { fmt.Sprintf(`Bind proxy relationship. Example: -$ %s tx staking proxy bind okexchain1hw4r48aww06ldrfeuq2v438ujnl6alsz0685a0 --from mykey +$ %s tx staking proxy bind ex1cftp8q8g4aa65nw9s5trwexe77d9t6cr8ndu02 --from mykey `, version.ClientName), ), diff --git a/x/staking/types/validator_test.go b/x/staking/types/validator_test.go index 48eebe45ed..f4e377993a 100644 --- a/x/staking/types/validator_test.go +++ b/x/staking/types/validator_test.go @@ -132,7 +132,7 @@ func TestValidatorMarshalUnmarshalJSON(t *testing.T) { js, err := codec.Cdc.MarshalJSON(validator) require.NoError(t, err) require.NotEmpty(t, js) - require.Contains(t, string(js), "\"consensus_pubkey\":\"okexchainvalconspub") + require.Contains(t, string(js), "\"consensus_pubkey\":\"exvalconspub") got := &Validator{} err = codec.Cdc.UnmarshalJSON(js, got) assert.NoError(t, err) diff --git a/x/token/genesis.go b/x/token/genesis.go index 5bce42255f..a56c6b161d 100644 --- a/x/token/genesis.go +++ b/x/token/genesis.go @@ -10,7 +10,7 @@ import ( ) // default owner of okt -const DefaultTokenOwner = "okexchain10q0rk5qnyag7wfvvt7rtphlw589m7frsku8qc9" +const DefaultTokenOwner = "ex1rf9wr069pt64e58f2w3mjs9w72g8vemzw26658" // all state that must be provided in genesis file type GenesisState struct { diff --git a/x/token/types/msgs_test.go b/x/token/types/msgs_test.go index 481a6b4173..87ea4a8e27 100644 --- a/x/token/types/msgs_test.go +++ b/x/token/types/msgs_test.go @@ -220,12 +220,12 @@ func TestNewTokenMultiSend(t *testing.T) { fromAddr := sdk.AccAddress(fromPubKey.Address()) // correct message - coinStr := `[{"to":"okexchain1dfpljpe0g0206jch32fx95lyagq3z5ws850m6f","amount":"1` + common.NativeToken + `"}]` + coinStr := `[{"to":"ex1jedas2n0pq2c68pelztgel8ht8pz50rh7s7vfz","amount":"1` + common.NativeToken + `"}]` transfers, err := StrToTransfers(coinStr) require.Nil(t, err) // coins not positive - toAddr0, err := sdk.AccAddressFromBech32("okexchain1dfpljpe0g0206jch32fx95lyagq3z5ws850m6f") + toAddr0, err := sdk.AccAddressFromBech32("ex1jedas2n0pq2c68pelztgel8ht8pz50rh7s7vfz") require.Nil(t, err) decCoin0 := sdk.NewDecCoinFromDec(common.NativeToken, sdk.NewDec(0)) transfers0 := []TransferUnit{ @@ -252,7 +252,7 @@ func TestNewTokenMultiSend(t *testing.T) { }{ {NewMsgMultiSend(fromAddr, transfers), nil}, {NewMsgMultiSend(sdk.AccAddress{}, transfers), ErrAddressIsRequired()}, - {NewMsgMultiSend(fromAddr, make([]TransferUnit, MultiSendLimit+1)),ErrMsgTransfersAmountBiggerThanSendLimit()}, + {NewMsgMultiSend(fromAddr, make([]TransferUnit, MultiSendLimit+1)), ErrMsgTransfersAmountBiggerThanSendLimit()}, {NewMsgMultiSend(fromAddr, transfers0), ErrInvalidCoins("0.000000000000000000okt")}, {NewMsgMultiSend(fromAddr, transfers1), ErrAddressIsRequired()}, } diff --git a/x/token/types/token.go b/x/token/types/token.go index 3a280df8a1..90abdc3024 100644 --- a/x/token/types/token.go +++ b/x/token/types/token.go @@ -13,7 +13,7 @@ type Token struct { WholeName string `json:"whole_name" v2:"whole_name"` // e.g. "OKT" OriginalTotalSupply sdk.Dec `json:"original_total_supply" v2:"original_total_supply"` // e.g. 1000000000.00000000 Type int `json:"type"` //e.g. 1 common token, 2 interest token - Owner sdk.AccAddress `json:"owner" v2:"owner"` // e.g. okexchain1hw4r48aww06ldrfeuq2v438ujnl6alsz0685a0 + Owner sdk.AccAddress `json:"owner" v2:"owner"` // e.g. ex1cftp8q8g4aa65nw9s5trwexe77d9t6cr8ndu02 Mintable bool `json:"mintable" v2:"mintable"` // e.g. false } diff --git a/x/token/types/token_test.go b/x/token/types/token_test.go index bfb6c78f8b..d49ce51b37 100644 --- a/x/token/types/token_test.go +++ b/x/token/types/token_test.go @@ -58,7 +58,7 @@ func TestCurrency(t *testing.T) { func TestToken(t *testing.T) { common.InitConfig() - addr, err := sdk.AccAddressFromBech32("okexchain1dfpljpe0g0206jch32fx95lyagq3z5ws850m6f") + addr, err := sdk.AccAddressFromBech32("ex1jedas2n0pq2c68pelztgel8ht8pz50rh7s7vfz") require.Nil(t, err) testCase := []struct { @@ -84,7 +84,7 @@ func TestToken(t *testing.T) { Type: 0, Owner: addr, Mintable: true, - }, `{"description":"okblockchain coin","symbol":"` + common.NativeToken + `","original_symbol":"` + common.NativeToken + `","whole_name":"ok coin","original_total_supply":"1000000000.000000000000000000","type":0,"owner":"okexchain1dfpljpe0g0206jch32fx95lyagq3z5ws850m6f","mintable":true}`}, + }, `{"description":"okblockchain coin","symbol":"` + common.NativeToken + `","original_symbol":"` + common.NativeToken + `","whole_name":"ok coin","original_total_supply":"1000000000.000000000000000000","type":0,"owner":"ex1jedas2n0pq2c68pelztgel8ht8pz50rh7s7vfz","mintable":true}`}, } for _, tokenCase := range testCase { b, err := json.Marshal(tokenCase.token) diff --git a/x/token/types/util_test.go b/x/token/types/util_test.go index 9132489f1f..25983ee36d 100644 --- a/x/token/types/util_test.go +++ b/x/token/types/util_test.go @@ -26,9 +26,9 @@ func TestStrToTransfers(t *testing.T) { common.InitConfig() //coinStr := `[{"to": "cosmos18ragjd23yv4ctjg3vadh43q5zf8z0hafm4qjrf", "amount": "1BNB,2BTC"}, //{"to": "cosmos18ragjd23yv4ctjg3vadh43q5zf8z0hafm4qjrf", "amount": "1OKB,2BTC"}]` - coinStr := `[{"to":"okexchain1dfpljpe0g0206jch32fx95lyagq3z5ws850m6f","amount":"1` + common.NativeToken + `"}]` + coinStr := `[{"to":"ex1jedas2n0pq2c68pelztgel8ht8pz50rh7s7vfz","amount":"1` + common.NativeToken + `"}]` coinStrError := `[{"to":"kochain1dfpljpe0g0206jch32fx95lyagq3z5ws2vgwx3","amount":"1` + common.NativeToken + `"}]` - addr, err := sdk.AccAddressFromBech32("okexchain1dfpljpe0g0206jch32fx95lyagq3z5ws850m6f") + addr, err := sdk.AccAddressFromBech32("ex1jedas2n0pq2c68pelztgel8ht8pz50rh7s7vfz") require.Nil(t, err) _, err = StrToTransfers(coinStrError) require.Error(t, err) @@ -44,7 +44,7 @@ func TestStrToTransfers(t *testing.T) { } require.EqualValues(t, transfer, transfers) - coinStr = `[{"to":"okexchain1dfpljpe0g0206jch32fx95lyagq3z5ws850m6f",amount":"1"}]` + coinStr = `[{"to":"ex1jedas2n0pq2c68pelztgel8ht8pz50rh7s7vfz",amount":"1"}]` _, err = StrToTransfers(coinStr) require.Error(t, err) } @@ -199,4 +199,4 @@ func TestValidateDenom(t *testing.T) { name = notAllowedPrefix + "_abc-123" + "_bcd" require.Nil(t, sdk.ValidateDenom(name)) -} \ No newline at end of file +}