-
Notifications
You must be signed in to change notification settings - Fork 40
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[R4R] Add max lock time in time lock plugin #641
Conversation
@@ -54,6 +55,10 @@ func (msg TimeLockMsg) ValidateBasic() sdk.Error { | |||
return ErrInvalidLockTime(DefaultCodespace, fmt.Sprintf("lock time(%d) should be larger than 0", msg.LockTime)) | |||
} | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do we need hard fork
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no, we do not, for there is no such txs included in block
plugins/tokens/timelock/msgs.go
Outdated
@@ -54,6 +55,10 @@ func (msg TimeLockMsg) ValidateBasic() sdk.Error { | |||
return ErrInvalidLockTime(DefaultCodespace, fmt.Sprintf("lock time(%d) should be larger than 0", msg.LockTime)) | |||
} | |||
|
|||
if msg.LockTime >= MaxLockTime { | |||
return ErrInvalidLockTime(DefaultCodespace, fmt.Sprintf("lock time(%d) should not be less than %d", msg.LockTime, MaxLockTime)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fmt.Sprintf("lock time(%d) should be less than %d", msg.LockTime, MaxLockTime)
MinLockTime = 60 * time.Second | ||
MaxDescriptionLength = 128 | ||
MinLockTime = 60 * time.Second | ||
MaxLockTime int64 = 253402300800 //seconds of 10000-01-01, which is required by amino |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
go format
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it's right
Description
fix: #640
Rationale
tell us why we need these changes...
Example
add an example CLI or API response...
Changes
Notable changes:
Preflight checks
make build
)make test
)make integration_test
)Already reviewed by
...
Related issues
... reference related issue #'s here ...