Skip to content

Commit

Permalink
use drawingInterval for UnstakeLockTime
Browse files Browse the repository at this point in the history
Signed-off-by: Adam Reif <Garandor@manta.network>
  • Loading branch information
Adam Reif authored and Adam Reif committed Jul 18, 2023
1 parent 2541aa5 commit 1d3691d
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion runtime/calamari/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -420,7 +420,7 @@ parameter_types! {
/// Time in blocks *before* a drawing in which modifications of the win-eligble pool are prevented
pub DrawingFreezeout: BlockNumber = prod_or_fast!(1 * DAYS, 3 * MINUTES);
/// Time in blocks until a collator is done unstaking
pub UnstakeLockTime: BlockNumber = LeaveDelayRounds::get() * DefaultBlocksPerRound::get();
pub UnstakeLockTime: BlockNumber = DrawingInterval::get();
}
impl pallet_lottery::Config for Runtime {
type RuntimeCall = RuntimeCall;
Expand Down
2 changes: 1 addition & 1 deletion runtime/manta/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -405,7 +405,7 @@ parameter_types! {
/// Time in blocks *before* a drawing in which modifications of the win-eligble pool are prevented
pub DrawingFreezeout: BlockNumber = prod_or_fast!(1 * DAYS, 3 * MINUTES);
/// Time in blocks until a collator is done unstaking
pub UnstakeLockTime: BlockNumber = LeaveDelayRounds::get() * DefaultBlocksPerRound::get();
pub UnstakeLockTime: BlockNumber = DrawingInterval::get();
}
impl pallet_lottery::Config for Runtime {
type RuntimeCall = RuntimeCall;
Expand Down
9 changes: 5 additions & 4 deletions scripts/lottery/fund_and_start.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,21 +11,22 @@ async function createPromiseApi(nodeAddress) {
}

async function main() {
const nodeAddress = "ws://127.0.0.1:9111";
// const nodeAddress = "ws://127.0.0.1:9111";
// const nodeAddress = 'ws://127.0.0.1:9944';
// const nodeAddress = 'wss://crispy.baikal.testnet.calamari.systems:443';
const nodeAddress = "wss://c1.baikal.testnet.manta.systems:443";
const api = await createPromiseApi(nodeAddress);

const aliceKey = keyring.addFromMnemonic(
"bottom drive obey lake curtain smoke basket hold race lonely fit walk//Alice"
);
const lotteryAccount = "dmwQify2zjqgMQfDhDQRppgEeBFVvJaX3bq3xqtFmM94PKfgY";
// const lotteryAccount = "dmwQify2zjqgMQfDhDQRppgEeBFVvJaX3bq3xqtFmM94PKfgY"; // calamari
const lotteryAccount = "dfZ2W8UPC9DhqQuL1FL8Jf1DSpCM6nrDjXdbZU96ViR1BJsBN"; // calamari

// fund lottery account with gas money
const id = new Uint8Array(32);
id[0] = 1;
const amount = new Uint8Array(16); // roughly 50k KMA
amount[7] = 1;
amount[9] = 100;
const transferTx = api.tx.mantaPay.publicTransfer(
{ id: id, value: amount },
lotteryAccount
Expand Down

0 comments on commit 1d3691d

Please sign in to comment.