Skip to content
This repository was archived by the owner on Nov 15, 2023. It is now read-only.
Merged
Changes from 1 commit
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
e0261a9
initial mock
shawntabrizi Jun 30, 2020
ed5cd01
remove statement
shawntabrizi Jun 30, 2020
6f8fde1
Merge branch 'master' into shawntabrizi-crowdsale
shawntabrizi Jun 30, 2020
3b4ef66
only work for dead accounts
shawntabrizi Jun 30, 2020
6f402bf
Revert "Merge branch 'master' into shawntabrizi-crowdsale"
shawntabrizi Jul 1, 2020
5ab1a00
Merge branch 'master' into shawntabrizi-crowdsale
shawntabrizi Jul 1, 2020
654639a
update storage name
shawntabrizi Jul 1, 2020
3c68158
Merge branch 'master' into shawntabrizi-crowdsale
shawntabrizi Jul 4, 2020
73ddd97
Re-mock
shawntabrizi Jul 6, 2020
54e664c
Update comment
shawntabrizi Jul 6, 2020
ce14d9a
payouts
shawntabrizi Jul 6, 2020
d5cac98
test signature verification
shawntabrizi Jul 7, 2020
b8a169b
Update wording
shawntabrizi Jul 7, 2020
c06039a
fix tests
shawntabrizi Jul 7, 2020
f148984
support both free and locked balance
shawntabrizi Jul 7, 2020
31f01b5
Single statement set in configuration trait
shawntabrizi Jul 7, 2020
3657abd
Configurable purchase limit, initiated status
shawntabrizi Jul 7, 2020
aa200cd
Account creation tests
shawntabrizi Jul 7, 2020
14204b9
make note about `max_amount` check
shawntabrizi Jul 7, 2020
a7b8832
Update validity status tests
shawntabrizi Jul 7, 2020
baa780a
update balance tests
shawntabrizi Jul 7, 2020
fdea379
payment test
shawntabrizi Jul 8, 2020
afec3aa
finish tests
shawntabrizi Jul 8, 2020
20bfbe9
Merge branch 'master' into shawntabrizi-purchase
shawntabrizi Jul 8, 2020
737fc3d
enable in runtime
shawntabrizi Jul 8, 2020
d0e4697
Test and verify ed25519
shawntabrizi Jul 8, 2020
d6a300c
make purchase pallet more configurable on the fly
shawntabrizi Jul 11, 2020
86b0533
Remove runtime check on purchase amount.
shawntabrizi Jul 11, 2020
28de90f
clean up trait
shawntabrizi Jul 11, 2020
4b125e0
Merge branch 'master' into shawntabrizi-purchase
shawntabrizi Jul 15, 2020
e3a6699
add basic weights
shawntabrizi Jul 16, 2020
fcdd41a
add extra super saftey check for vesting
shawntabrizi Jul 16, 2020
83260af
Add vat tracking
shawntabrizi Jul 16, 2020
833f5b7
remove unused const
shawntabrizi Jul 16, 2020
30ce018
Update to W3F Origins
shawntabrizi Jul 16, 2020
2a9ea82
remove stale comment
shawntabrizi Jul 17, 2020
bd32a91
Support existing accounts w/o existing vesting schedule
shawntabrizi Jul 17, 2020
c54dbf6
Update runtime/common/src/purchase.rs
shawntabrizi Jul 17, 2020
b7f54ff
Add support for partially unlocked portion of purchased DOTs
shawntabrizi Jul 17, 2020
aa24319
Merge branch 'master' into shawntabrizi-purchase
shawntabrizi Jul 17, 2020
3a3e530
add trait import
shawntabrizi Jul 17, 2020
d962514
Expose constants from pallet
shawntabrizi Jul 17, 2020
2cd07f2
Merge branch 'master' into shawntabrizi-purchase
shawntabrizi Jul 17, 2020
f9f1e17
Merge remote-tracking branch 'origin/master' into shawntabrizi-purchase
gavofyork Jul 17, 2020
9143005
Fixes
gavofyork Jul 17, 2020
1682b23
Fixes
gavofyork Jul 17, 2020
28a91ab
Update runtime/polkadot/src/lib.rs
shawntabrizi Jul 17, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Update runtime/common/src/purchase.rs
Co-authored-by: Gavin Wood <gavin@parity.io>
  • Loading branch information
shawntabrizi and gavofyork authored Jul 17, 2020
commit c54dbf6e9c80431e3d2a89a0c6b6c09e25c80d20
6 changes: 4 additions & 2 deletions runtime/common/src/purchase.rs
Original file line number Diff line number Diff line change
Expand Up @@ -268,13 +268,15 @@ decl_module! {
// We checked that this account has no existing vesting schedule. So this function should
// never fail, however if it does, not much we can do about it at this point.
let unlock_block = UnlockBlock::<T>::get();
let unlocked = (status.locked_balance * T::UnlockedProportion::get()).max(T::MaxUnlocked::get());
let locked = status.locked_balance.saturating_sub(unlocked);
let _ = T::VestingSchedule::add_vesting_schedule(
// Apply vesting schedule to this user
&who,
// For this much amount
status.locked_balance,
locked,
// Unlocking the full amount after one block
status.locked_balance,
locked,
// When everything unlocks
unlock_block
);
Expand Down