Skip to content
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

Merged
merged 4 commits into from
Aug 5, 2019
Merged

[R4R] Add max lock time in time lock plugin #641

merged 4 commits into from
Aug 5, 2019

Conversation

yutianwu
Copy link
Contributor

@yutianwu yutianwu commented Aug 5, 2019

Description

fix: #640

Rationale

tell us why we need these changes...

Example

add an example CLI or API response...

Changes

Notable changes:

  • add each change in a bullet point here
  • ...

Preflight checks

  • build passed (make build)
  • tests passed (make test)
  • integration tests passed (make integration_test)
  • manual transaction test passed (cli invoke)

Already reviewed by

...

Related issues

... reference related issue #'s here ...

@@ -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))
}

Copy link
Contributor

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

Copy link
Contributor Author

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

@@ -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))
Copy link
Contributor

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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

go format

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's right

@yutianwu yutianwu merged commit 6add6f8 into develop Aug 5, 2019
This was referenced Aug 12, 2019
@unclezoro unclezoro deleted the fix_amino branch May 10, 2022 06:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants