-
Notifications
You must be signed in to change notification settings - Fork 305
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
tests(app): 🎇 mock consensus delegates, and undelegates, to a validator #4044
Conversation
i'll tackle this tomorrow, delegating currently fails. i imagine i will need to flesh out more of the details in that transaction. |
4628023
to
b88730d
Compare
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.
note for review: the diff on this looks very strange here, side-by-side view is probably best.
outlines two variables in `Delegate` into methods. these will be used by our staking test to facilitate the construction of delegation transactions.
see #3995. this test now delegates to, and then undelegates from, a validator. this does not yet include all of the assertions we would like to exercise in this test, but it does show that a validator correctly progresses through the active and defined states. in further work, we will fill out the other assertions described in #3995, particularly w.r.t. voting power and validator uptime.
b88730d
to
0796223
Compare
amount: self.delegation_amount, | ||
asset_id: self.delegation_token().id(), | ||
}); | ||
let stake: Balance = self.unbonded_value().into(); |
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.
Totally subjective and lgtm, but I have come to appreciate struct literals because they make it immediately apparent what data we are constructing vs. using constructors that add a level of indirection.
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.
agree! this came out of a pairing session with henry, because want to use those same literals in the mock_consensus_staking
test
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.
Race condition :) |
see #3995.
this test now delegates to, and then undelegates from, a validator.
this does not yet include all of the assertions we would like to
exercise in this test, but it does show that a validator correctly
progresses through the active and defined states.
in further work, we will fill out the other assertions described
in #3995, particularly w.r.t. voting power and validator uptime.