Skip to content
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

Closed
wants to merge 39 commits into from
Closed

Conversation

assafmo
Copy link
Contributor

@assafmo assafmo commented Aug 8, 2024

  • Happy path
    • step 1: liquid stake
    • step 2: trigger a batch undelegation
  • TODO: failure paths

sampocs and others added 30 commits June 12, 2024 21:05
@assafmo assafmo requested a review from sampocs August 8, 2024 18:46
Comment on lines -82 to +105
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");
Copy link
Contributor Author

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

Copy link
Collaborator

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

@sampocs sampocs changed the base branch from v23 to main August 20, 2024 14:45
@sampocs
Copy link
Collaborator

sampocs commented Aug 20, 2024

closing in favor of #1269 which is branched off main

@sampocs sampocs closed this Aug 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants