Skip to content

Commit 6044b45

Browse files
author
HaoyangLiu
committed
Resolve comment
1 parent 233907b commit 6044b45

File tree

9 files changed

+29
-25
lines changed

9 files changed

+29
-25
lines changed

Makefile

+2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
PACKAGES_NOSIMULATION=$(shell go list ./... | grep -v '/simulation' | grep -v '/prometheus' | grep -v '/clitest' | grep -v '/lcd' | grep -v '/protobuf')
22
PACKAGES_MODULES=$(shell go list ./... | grep 'modules')
3+
PACKAGES_TYPES=$(shell go list ./... | grep 'types')
34
PACKAGES_SIMTEST=$(shell go list ./... | grep '/simulation')
45

56
all: get_tools get_vendor_deps install
@@ -119,6 +120,7 @@ test_sim: test_sim_modules test_sim_benchmark test_sim_iris_nondeterminism test_
119120
test_unit:
120121
#@go test $(PACKAGES_NOSIMULATION)
121122
@go test $(PACKAGES_MODULES)
123+
@go test $(PACKAGES_TYPES)
122124

123125
test_cli:
124126
@go test -timeout 20m -count 1 -p 1 client/clitest/utils.go client/clitest/bank_test.go client/clitest/distribution_test.go client/clitest/gov_test.go client/clitest/iparam_test.go client/clitest/irismon_test.go client/clitest/record_test.go client/clitest/service_test.go client/clitest/stake_test.go

client/stake/cli/query.go

+11-8
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@ import (
1919
// GetCmdQueryValidator implements the validator query command.
2020
func GetCmdQueryValidator(storeName string, cdc *codec.Codec) *cobra.Command {
2121
cmd := &cobra.Command{
22-
Use: "validator [owner-addr]",
22+
Use: "validator [validator-address]",
2323
Short: "Query a validator",
24-
Example: "iriscli stake validator <validator owner address>",
24+
Example: "iriscli stake validator <validator address>",
2525
Args: cobra.ExactArgs(1),
2626
RunE: func(cmd *cobra.Command, args []string) error {
2727
addr, err := sdk.ValAddressFromBech32(args[0])
@@ -129,8 +129,9 @@ func GetCmdQueryValidators(storeName string, cdc *codec.Codec) *cobra.Command {
129129
// GetCmdQueryValidatorUnbondingDelegations implements the query all unbonding delegatations from a validator command.
130130
func GetCmdQueryValidatorUnbondingDelegations(queryRoute string, cdc *codec.Codec) *cobra.Command {
131131
cmd := &cobra.Command{
132-
Use: "unbonding-delegations-from [operator-addr]",
132+
Use: "unbonding-delegations-from [validator-address]",
133133
Short: "Query all unbonding delegatations from a validator",
134+
Example: "iriscli stake unbonding-delegations-from <validator address>",
134135
Args: cobra.ExactArgs(1),
135136
RunE: func(cmd *cobra.Command, args []string) error {
136137
valAddr, err := sdk.ValAddressFromBech32(args[0])
@@ -158,8 +159,9 @@ func GetCmdQueryValidatorUnbondingDelegations(queryRoute string, cdc *codec.Code
158159
// GetCmdQueryValidatorRedelegations implements the query all redelegatations from a validator command.
159160
func GetCmdQueryValidatorRedelegations(queryRoute string, cdc *codec.Codec) *cobra.Command {
160161
cmd := &cobra.Command{
161-
Use: "redelegations-from [operator-addr]",
162+
Use: "redelegations-from [validator-address]",
162163
Short: "Query all outgoing redelegatations from a validator",
164+
Example: "iriscli stake redelegations-from <validator address>",
163165
Args: cobra.ExactArgs(1),
164166
RunE: func(cmd *cobra.Command, args []string) error {
165167
valAddr, err := sdk.ValAddressFromBech32(args[0])
@@ -247,7 +249,7 @@ func GetCmdQueryDelegation(storeName string, cdc *codec.Codec) *cobra.Command {
247249
// made from one delegator.
248250
func GetCmdQueryDelegations(storeName string, cdc *codec.Codec) *cobra.Command {
249251
cmd := &cobra.Command{
250-
Use: "delegations [delegator-addr]",
252+
Use: "delegations [delegator-address]",
251253
Short: "Query all delegations made from one delegator",
252254
Example: "iriscli stake delegations <delegator address>",
253255
Args: cobra.ExactArgs(1),
@@ -292,8 +294,9 @@ func GetCmdQueryDelegations(storeName string, cdc *codec.Codec) *cobra.Command {
292294
// delegations to a specific validator.
293295
func GetCmdQueryValidatorDelegations(queryRoute string, cdc *codec.Codec) *cobra.Command {
294296
cmd := &cobra.Command{
295-
Use: "delegations-to [validator-addr]",
297+
Use: "delegations-to [validator-address]",
296298
Short: "Query all delegations made to one validator",
299+
Example: "iriscli stake delegations-to <validator address>",
297300
Args: cobra.ExactArgs(1),
298301
RunE: func(cmd *cobra.Command, args []string) error {
299302
validatorAddr, err := sdk.ValAddressFromBech32(args[0])
@@ -381,7 +384,7 @@ func GetCmdQueryUnbondingDelegation(storeName string, cdc *codec.Codec) *cobra.C
381384
// unbonding-delegation records for a delegator.
382385
func GetCmdQueryUnbondingDelegations(storeName string, cdc *codec.Codec) *cobra.Command {
383386
cmd := &cobra.Command{
384-
Use: "unbonding-delegations [delegator-addr]",
387+
Use: "unbonding-delegations [delegator-address]",
385388
Short: "Query all unbonding-delegations records for one delegator",
386389
Example: "iriscli stake unbonding-delegation <delegator address>",
387390
Args: cobra.ExactArgs(1),
@@ -491,7 +494,7 @@ func GetCmdQueryRedelegation(storeName string, cdc *codec.Codec) *cobra.Command
491494
// redelegation records for a delegator.
492495
func GetCmdQueryRedelegations(storeName string, cdc *codec.Codec) *cobra.Command {
493496
cmd := &cobra.Command{
494-
Use: "redelegations [delegator-addr]",
497+
Use: "redelegations [delegator-address]",
495498
Short: "Query all redelegations records for one delegator",
496499
Example: "iriscli stake redelegations <delegator address>",
497500
Args: cobra.ExactArgs(1),

init/gentx.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ import (
2424
)
2525

2626
const (
27-
defaultAmount = "100000000000000000000" + stakeTypes.StakeDenom
27+
defaultAmount = "100" + stakeTypes.StakeDenomName
2828
defaultCommissionRate = "0.1"
2929
defaultCommissionMaxRate = "0.2"
3030
defaultCommissionMaxChangeRate = "0.01"

modules/bank/msgs_test.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ func TestMsgSendGetSignBytes(t *testing.T) {
186186
}
187187
res := msg.GetSignBytes()
188188

189-
expected := `{"inputs":[{"address":"cosmos1d9h8qat57ljhcm","coins":[{"amount":"10","denom":"atom"}]}],"outputs":[{"address":"cosmos1da6hgur4wsmpnjyg","coins":[{"amount":"10","denom":"atom"}]}]}`
189+
expected := `{"inputs":[{"address":"faa1d9h8qat5umnd2g","coins":[{"amount":"10","denom":"atom"}]}],"outputs":[{"address":"faa1da6hgur4wstza6a7","coins":[{"amount":"10","denom":"atom"}]}]}`
190190
require.Equal(t, expected, string(res))
191191
}
192192

@@ -256,7 +256,7 @@ func TestMsgIssueGetSignBytes(t *testing.T) {
256256
}
257257
res := msg.GetSignBytes()
258258

259-
expected := `{"banker":"cosmos1d9h8qat57ljhcm","outputs":[{"address":"cosmos1d3hkzm3dveex7mfdvfsku6cjngpcj","coins":[{"amount":"10","denom":"atom"}]}]}`
259+
expected := `{"banker":"faa1d9h8qat5umnd2g","outputs":[{"address":"faa1d3hkzm3dveex7mfdvfsku6crf5s7g","coins":[{"amount":"10","denom":"atom"}]}]}`
260260
require.Equal(t, expected, string(res))
261261
}
262262

modules/record/msgs_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import (
55
"testing"
66
"time"
77

8-
"github.com/irisnet/irishub/simulation/mock"
8+
"github.com/irisnet/irishub/modules/mock"
99
"github.com/stretchr/testify/require"
1010

1111
sdk "github.com/irisnet/irishub/types"

modules/slashing/msg_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,5 @@ func TestMsgUnjailGetSignBytes(t *testing.T) {
1212
addr := sdk.AccAddress("abcd")
1313
msg := NewMsgUnjail(sdk.ValAddress(addr))
1414
bytes := msg.GetSignBytes()
15-
require.Equal(t, string(bytes), `{"address":"cosmosvaloper1v93xxeqhg9nn6"}`)
15+
require.Equal(t, string(bytes), `{"address":"fva1v93xxeq8upjwp"}`)
1616
}

modules/stake/types/validator_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,7 @@ func TestValidatorMarshalUnmarshalJSON(t *testing.T) {
263263
js, err := codec.Cdc.MarshalJSON(validator)
264264
require.NoError(t, err)
265265
require.NotEmpty(t, js)
266-
require.Contains(t, string(js), "\"consensus_pubkey\":\"cosmosvalconspu")
266+
require.Contains(t, string(js), "\"consensus_pubkey\":\"fcp")
267267
got := &Validator{}
268268
err = codec.Cdc.UnmarshalJSON(js, got)
269269
assert.NoError(t, err)

types/address.go

+6-6
Original file line numberDiff line numberDiff line change
@@ -18,17 +18,17 @@ const (
1818
AddrLen = 20
1919

2020
// Bech32PrefixAccAddr defines the Bech32 prefix of an account's address
21-
Bech32PrefixAccAddr = "cosmos"
21+
Bech32PrefixAccAddr = "faa"
2222
// Bech32PrefixAccPub defines the Bech32 prefix of an account's public key
23-
Bech32PrefixAccPub = "cosmospub"
23+
Bech32PrefixAccPub = "fap"
2424
// Bech32PrefixValAddr defines the Bech32 prefix of a validator's operator address
25-
Bech32PrefixValAddr = "cosmosvaloper"
25+
Bech32PrefixValAddr = "fva"
2626
// Bech32PrefixValPub defines the Bech32 prefix of a validator's operator public key
27-
Bech32PrefixValPub = "cosmosvaloperpub"
27+
Bech32PrefixValPub = "fvp"
2828
// Bech32PrefixConsAddr defines the Bech32 prefix of a consensus node address
29-
Bech32PrefixConsAddr = "cosmosvalcons"
29+
Bech32PrefixConsAddr = "fca"
3030
// Bech32PrefixConsPub defines the Bech32 prefix of a consensus node public key
31-
Bech32PrefixConsPub = "cosmosvalconspub"
31+
Bech32PrefixConsPub = "fcp"
3232
)
3333

3434
// ----------------------------------------------------------------------------

types/coin_test.go

+4-5
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import (
66

77
"github.com/stretchr/testify/assert"
88
"github.com/stretchr/testify/require"
9-
stakeTypes "github.com/irisnet/irishub/modules/stake/types"
109
)
1110

1211
func TestIsPositiveCoin(t *testing.T) {
@@ -50,8 +49,8 @@ func TestSameDenomAsCoin(t *testing.T) {
5049
{NewInt64Coin("A", 1), NewInt64Coin("A", 1), true},
5150
{NewInt64Coin("A", 1), NewInt64Coin("a", 1), false},
5251
{NewInt64Coin("a", 1), NewInt64Coin("b", 1), false},
53-
{NewInt64Coin(stakeTypes.DefaultBondDenom, 1), NewInt64Coin(stakeTypes.DefaultBondDenom, 10), true},
54-
{NewInt64Coin(stakeTypes.DefaultBondDenom, -11), NewInt64Coin(stakeTypes.DefaultBondDenom, 10), true},
52+
{NewInt64Coin("iris-atto", 1), NewInt64Coin("iris-atto", 10), true},
53+
{NewInt64Coin("iris-atto", -11), NewInt64Coin("iris-atto", 10), true},
5554
}
5655

5756
for tcIndex, tc := range cases {
@@ -108,8 +107,8 @@ func TestIsEqualCoin(t *testing.T) {
108107
{NewInt64Coin("A", 1), NewInt64Coin("A", 1), true},
109108
{NewInt64Coin("A", 1), NewInt64Coin("a", 1), false},
110109
{NewInt64Coin("a", 1), NewInt64Coin("b", 1), false},
111-
{NewInt64Coin(stakeTypes.DefaultBondDenom, 1), NewInt64Coin(stakeTypes.DefaultBondDenom, 10), false},
112-
{NewInt64Coin(stakeTypes.DefaultBondDenom, -11), NewInt64Coin(stakeTypes.DefaultBondDenom, 10), false},
110+
{NewInt64Coin("iris-atto", 1), NewInt64Coin("iris-atto", 10), false},
111+
{NewInt64Coin("iris-atto", -11), NewInt64Coin("iris-atto", 10), false},
113112
}
114113

115114
for tcIndex, tc := range cases {

0 commit comments

Comments
 (0)