Skip to content

Commit 1a62dec

Browse files
Merge pull request #1332 from galacticcouncil/feat/lift-lockdown
chore: lift lockdown script
2 parents 9668a94 + f0fae78 commit 1a62dec

File tree

1 file changed

+39
-0
lines changed

1 file changed

+39
-0
lines changed

scripts/mint-limit/liftLockdown.js

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
import {ApiPromise, WsProvider} from '@polkadot/api';
2+
3+
/* ========= CONFIG ========= */
4+
5+
const RPC = 'wss://hydration.ibp.network';
6+
const TC_THRESHOLD = 4;
7+
const ASSET_ID = 40;
8+
9+
/* ========= MAIN ========= */
10+
11+
(async () => {
12+
try {
13+
const provider = new WsProvider(RPC);
14+
const api = await ApiPromise.create({provider, noInitWarn: true});
15+
16+
// Build the circuitBreaker.forceLiftLockdown call
17+
const forceLiftCall = api.tx.circuitBreaker.forceLiftLockdown(ASSET_ID);
18+
19+
// Calculate lengthBound for the proposal
20+
const lengthBound = forceLiftCall.method.encodedLength ?? forceLiftCall.method.toU8a().length;
21+
22+
// Wrap in technicalCommittee.propose
23+
const tcProposal = api.tx.technicalCommittee.propose(
24+
TC_THRESHOLD,
25+
forceLiftCall.method,
26+
lengthBound
27+
);
28+
29+
console.log('--- forceLiftLockdown call (human) ---\n', forceLiftCall.method.toHuman());
30+
console.log('\n--- TC propose (human) ---\n', tcProposal.method.toHuman());
31+
console.log('\n--- TC propose HEX (submit as call) ---\n', tcProposal.method.toHex());
32+
console.log('\n--- Length bound ---\n', lengthBound);
33+
34+
await api.disconnect();
35+
} catch (e) {
36+
console.error('\nERROR:', e.message || e);
37+
process.exit(1);
38+
}
39+
})();

0 commit comments

Comments
 (0)