-
Notifications
You must be signed in to change notification settings - Fork 208
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
Batch undelegation integration tests #1259
Conversation
assafmo
commented
Aug 8, 2024
- Happy path
- step 1: liquid stake
- step 2: trigger a batch undelegation
- TODO: failure paths
…ng comment, check halted in claim
done the liquid stake part, now need to trigger a batch redelegation
console.log("waiting for chain to start..."); | ||
while (true) { | ||
try { | ||
const block = | ||
await accounts.user.query.cosmos.base.tendermint.v1beta1.getLatestBlock( | ||
{}, | ||
); | ||
if (name === "user") { | ||
const signer = await Secp256k1HdWallet.fromMnemonic(mnemonic); | ||
|
||
if (block?.block?.header.height! > 0n) { | ||
break; | ||
} | ||
// get signer address | ||
const [{ address }] = await signer.getAccounts(); | ||
|
||
await sleep(50); | ||
} catch (error) {} | ||
gaiaAccounts = { | ||
user: await StrideClient.create(HUB_RPC_ENDPOINT, signer, address, { | ||
gasPrice: GasPrice.fromString("0.025uatom"), | ||
broadcastPollIntervalMs: 50, | ||
resolveIbcResponsesCheckIntervalMs: 50, | ||
}), | ||
}; | ||
} | ||
} | ||
console.log("waiting for stride to start..."); | ||
await waitForChain(accounts.user, "ustrd"); | ||
|
||
console.log("waiting for gaia to start..."); | ||
await waitForChain(gaiaAccounts.user, "uatom"); |
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.
just a refactor of the "waitForChain" logic
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.
were you running into any issues with the approach that checked for the latest block? Seems a bit more elegant that way rather than submitting a tx
closing in favor of #1269 which is branched off main |