-
Notifications
You must be signed in to change notification settings - Fork 18
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
Migration pallet #190
Migration pallet #190
Conversation
a55ce2b
to
a7f5a51
Compare
/// Burns the free `DOCK` balance of the sender and emits an event containing the supplied recipient `cheqd` address. | ||
/// By submitting this transaction, you agree to the Terms and Conditions. | ||
#[pallet::weight(SubstrateWeight::<T::DbWeight>::migrate())] | ||
pub fn migrate(origin: OriginFor<T>, cheqd_address: String) -> DispatchResultWithPostInfo { |
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.
Wasn't it decided that people can migrate specified balance and not entire balance?
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.
The last decision was to migrate the full balance.
dock_account, | ||
cheqd_account, | ||
dock_tokens_amount, | ||
accepted_terms_and_conditions: true, |
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.
When would this be false?
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.
Never; this fact should just be mentioned at the event.
Alternatively, we could have this flag as a transaction parameter, and only emit an event in case it was set to true
.
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.
Whats the significance then? And if its a transaction parameter, how would the transaction behave on different values of it? Isn't calling migrate implying that caller accepts the terms?
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.
I was asked to add this field by @mike-parkhill. I guess that it has a demonstrative meaning.
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.
Ok. I still don't understand what its demonstrating.
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.
I see you're argument that we may not need it. But, it makes the acceptance explicit rather than implicit which is generally easier to defend if we ever get called on it.
Going through the migration page we're building will make it mandatory as part of the flow, but for blockchain clients who want to submit it themselves we still need to get them to show they accept the terms and conditions somehow. This was my suggestion for how to do that. I'm open to other suggestions that achieve the same thing.
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.
With blockchain, the acceptance is always implicit, no? Eg. when you make a transfer txn, its understood that you can't ask the chain to revert that transfer. Secondly there is no way to do that txn while not accepting the terms and its not known what we would do differently if we allowed that.
Anyway, I don't think its a major problem so if it makes you feel safer or more compliant, we can go ahead with this.
pub struct Pallet<T>(_); | ||
|
||
#[pallet::call] | ||
impl<T: Config> Pallet<T> { |
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.
Is there a need of a flag which prevents people from migrating unless we officially start the migration?
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.
I thought we could publish the upgrade containing this pallet along with the migration start.
0564293
to
46c2985
Compare
No description provided.