-
Notifications
You must be signed in to change notification settings - Fork 13
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
added flag to track the withdrawl of fund for milestones #257
Changes from 3 commits
4e9871c
0d03460
43fbd76
86360ca
ed6fc1b
9a0f26a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -454,6 +454,7 @@ pub mod pallet { | |
milestone_key, | ||
percentage_to_unlock: milestone.percentage_to_unlock, | ||
is_approved: false, | ||
withdrawn: false, | ||
}; | ||
milestones | ||
.try_insert(milestone_key, milestone) | ||
|
@@ -485,6 +486,7 @@ pub mod pallet { | |
agreement_hash: brief_hash, | ||
funding_type, | ||
deposit_id, | ||
payment_address: [0; 20], | ||
}; | ||
|
||
Projects::<T>::insert(project_key, project); | ||
|
@@ -527,6 +529,7 @@ pub struct Milestone { | |
pub milestone_key: MilestoneKey, | ||
pub percentage_to_unlock: Percent, | ||
pub is_approved: bool, | ||
pub withdrawn: bool, | ||
} | ||
|
||
/// The vote struct is used to | ||
|
@@ -562,6 +565,7 @@ pub struct Project<T: Config> { | |
pub cancelled: bool, | ||
pub funding_type: FundingType, | ||
pub deposit_id: DepositIdOf<T>, | ||
pub payment_address: [u8; 20], | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is meant to signal where the tokens will end up. check telegram when you get a minute! There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sure |
||
} | ||
|
||
/// The contribution users made to a proposal project. | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -273,6 +273,7 @@ pub mod v3 { | |
milestone.percentage_to_unlock as u8, | ||
), | ||
is_approved: milestone.is_approved, | ||
withdrawn: milestone.withdrawn | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. how will these migrations work, the old data doesnt have these flags. You can default them |
||
}, | ||
); | ||
}); | ||
|
@@ -296,6 +297,7 @@ pub mod v3 { | |
funding_type: FundingType::Proposal, | ||
// A deposit_id of u32::MAX is ignored. | ||
deposit_id: u32::MAX.into(), | ||
payment_address: project.payment_address, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this should default to the initiator address |
||
}; | ||
Some(migrated_project) | ||
} else { | ||
|
@@ -680,6 +682,7 @@ pub mod v6 { | |
|
||
#[cfg(test)] | ||
mod test { | ||
use std::io::Read; | ||
use super::*; | ||
use mock::*; | ||
use test_utils::*; | ||
|
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 is nice, We can now remove this possibly troublesome line
if p.withdrawn_funds == p.raised_funds {
which doesnt handle with dust at all and replace it with something like.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.
agreed