-
Notifications
You must be signed in to change notification settings - Fork 115
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
go staking: disable all transactions for locked accounts #2727
Conversation
e93f8ae
to
913bd31
Compare
Codecov Report
@@ Coverage Diff @@
## master #2727 +/- ##
==========================================
- Coverage 63.22% 62.97% -0.25%
==========================================
Files 378 378
Lines 35532 35539 +7
==========================================
- Hits 22464 22382 -82
- Misses 10248 10342 +94
+ Partials 2820 2815 -5
Continue to review full report at Codecov.
|
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.
This approach seems error-prone as it is easy to forget a place where general balance is used. Wouldn't it be cleaner to have the locked funds in a separate Locked
subaccount and then have an operation to move the funds to the general balance?
The operation for unlocking could be a self-transfer, or (IMO nicer as it is more explicit) a special transaction. Of course introducing a new staking transaction will have some people cry "but but Ledger" but support is not actually needed until the first unlock period expires which should be some time out.
@@ -77,12 +77,14 @@ type Context struct { | |||
} | |||
|
|||
// NewMockContext creates a new mock context for use in tests. | |||
func NewMockContext(mode ContextMode, now time.Time) *Context { | |||
func NewMockContext(mode ContextMode, now time.Time, state *iavl.MutableTree) *Context { |
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.
We should remove this now that we have mock application state (I actually removed it in #2674). Can you use NewMockApplicationState
in tests instead as it already handles creating a new in-memory tree for you?
could we ditch this and program in the locked funds in terms of debonding entries? |
^ #2747 |
Co-Authored-By: Jernej Kos <[email protected]>
we'll go without this feature as implemented. the current idea is to put locked tokens in debonding delegations at genesis. we added a test for this use case in #2747 |
The account field
general.transfers_not_before
is replaced withgeneral.not_before
. Accounts can't send any transaction before the epoch in that field.