Skip to content
This repository was archived by the owner on Dec 21, 2022. It is now read-only.

Commit 3aba61b

Browse files
authored
Merge pull request: refactor func HigherThanMercury(height int64) a bit (#98)
1 parent 6adf841 commit 3aba61b

File tree

2 files changed

+21
-17
lines changed

2 files changed

+21
-17
lines changed

types/milestone.go

Lines changed: 20 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,11 @@ import (
55
"sync"
66
)
77

8+
// Disable followings after milestoneMercuryHeight
9+
// 1. TransferToContractBlock
10+
// 2. ChangeEvmDenomByProposal
11+
// 3. BankTransferBlock
12+
813
var (
914
MILESTONE_MERCURY_HEIGHT string
1015
milestoneMercuryHeight int64
@@ -33,26 +38,25 @@ func init() {
3338
}
3439

3540
//disable transfer tokens to contract address by cli
36-
func higherThanMercury(height int64) bool {
41+
func HigherThanMercury(height int64) bool {
3742
if milestoneMercuryHeight == 0 {
3843
// milestoneMercuryHeight not enabled
3944
return false
4045
}
4146
return height > milestoneMercuryHeight
4247
}
4348

44-
45-
//disable transfer tokens to contract address by cli
46-
func IsDisableTransferToContractBlock(height int64) bool {
47-
return higherThanMercury(height)
48-
}
49-
50-
//disable change the param EvmDenom by proposal
51-
func IsDisableChangeEvmDenomByProposal(height int64) bool {
52-
return higherThanMercury(height)
53-
}
54-
55-
//disable transfer tokens by module of cosmos-sdk/bank
56-
func IsDisableBankTransferBlock(height int64) bool {
57-
return higherThanMercury(height)
58-
}
49+
////disable transfer tokens to contract address by cli
50+
//func IsDisableTransferToContractBlock(height int64) bool {
51+
// return higherThanMercury(height)
52+
//}
53+
//
54+
////disable change the param EvmDenom by proposal
55+
//func IsDisableChangeEvmDenomByProposal(height int64) bool {
56+
// return higherThanMercury(height)
57+
//}
58+
//
59+
////disable transfer tokens by module of cosmos-sdk/bank
60+
//func IsDisableBankTransferBlock(height int64) bool {
61+
// return higherThanMercury(height)
62+
//}

x/bank/handler.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import (
1111
func NewHandler(k keeper.Keeper) sdk.Handler {
1212
return func(ctx sdk.Context, msg sdk.Msg) (*sdk.Result, error) {
1313

14-
if sdk.IsDisableBankTransferBlock(ctx.BlockHeight()) {
14+
if sdk.HigherThanMercury(ctx.BlockHeight()) {
1515
return nil, sdkerrors.Wrap(sdkerrors.ErrUnknownRequest, "bank message is disabled")
1616
}
1717

0 commit comments

Comments
 (0)