Skip to content

Commit

Permalink
fix authz tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Anmol1696 committed Jan 31, 2025
1 parent b15e2b5 commit c9f468e
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 13 deletions.
11 changes: 6 additions & 5 deletions packages/starship/__tests__/v0/gov.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { generateMnemonic } from '@confio/relayer/build/lib/helpers';
import { assertIsDeliverTxSuccess } from '@cosmjs/stargate';
import { DirectSecp256k1HdWallet } from '@cosmjs/proto-signing';
import Long from 'long';
import BigNumber from 'bignumber.js';

import { cosmos, getSigningOsmosisClient } from '../../src/codegen';
Expand Down Expand Up @@ -158,7 +159,7 @@ describe('Governance tests for osmosis', () => {

it('query proposal', async () => {
const result = await queryClient.cosmos.gov.v1beta1.proposal({
proposalId: BigInt(proposalId)
proposalId: Long.fromString(proposalId)
});

expect(result.proposal.proposalId.toString()).toEqual(proposalId);
Expand All @@ -173,7 +174,7 @@ describe('Governance tests for osmosis', () => {

// Vote on proposal from genesis mnemonic address
const msg = cosmos.gov.v1beta1.MessageComposer.withTypeUrl.vote({
proposalId: BigInt(proposalId),
proposalId: Long.fromString(proposalId),
voter: address,
option: cosmos.gov.v1beta1.VoteOption.VOTE_OPTION_YES
});
Expand All @@ -194,7 +195,7 @@ describe('Governance tests for osmosis', () => {

it('verify vote', async () => {
const { vote } = await queryClient.cosmos.gov.v1beta1.vote({
proposalId: BigInt(proposalId),
proposalId: Long.fromString(proposalId),
voter: address
});

Expand All @@ -205,15 +206,15 @@ describe('Governance tests for osmosis', () => {
it('wait for voting period to end', async () => {
// wait for the voting period to end
const { proposal } = await queryClient.cosmos.gov.v1beta1.proposal({
proposalId: BigInt(proposalId)
proposalId: Long.fromString(proposalId)
});

await expect(waitUntil(proposal.votingEndTime)).resolves.not.toThrow();
}, 200000);

it('verify proposal passed', async () => {
const { proposal } = await queryClient.cosmos.gov.v1beta1.proposal({
proposalId: BigInt(proposalId)
proposalId: Long.fromString(proposalId)
});

expect(proposal.status).toEqual(
Expand Down
16 changes: 8 additions & 8 deletions packages/starship/__tests__/v1/authz.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ describe("Authz testing", () => {
amount: [
{
denom,
amount: "100000",
amount: "1000000",
},
],
gas: "550000",
Expand Down Expand Up @@ -174,7 +174,7 @@ describe("Authz testing", () => {
amount: [
{
denom,
amount: "100000",
amount: "1000000",
},
],
gas: "550000",
Expand Down Expand Up @@ -228,7 +228,7 @@ describe("Authz testing", () => {
amount: [
{
denom,
amount: "100000",
amount: "1000000",
},
],
gas: "550000",
Expand Down Expand Up @@ -300,7 +300,7 @@ describe("Authz testing", () => {
amount: [
{
denom,
amount: "100000",
amount: "1000000",
},
],
gas: "550000",
Expand Down Expand Up @@ -339,7 +339,7 @@ describe("Authz testing", () => {

console.log(balance)

expect(balance?.amount).toEqual("9999990000"); // not 10000000000, due to fees deduction
expect(balance?.amount).toEqual("9999090000"); // not 10000000000, due to fees deduction
}, 2000000);

it("revoke address2 vote auth", async () => {
Expand All @@ -356,7 +356,7 @@ describe("Authz testing", () => {
amount: [
{
denom,
amount: "100000",
amount: "1000000",
},
],
gas: "550000",
Expand Down Expand Up @@ -405,7 +405,7 @@ describe("Authz testing", () => {
amount: [
{
denom,
amount: "100000",
amount: "1000000",
},
],
gas: "550000",
Expand Down Expand Up @@ -446,7 +446,7 @@ describe("Authz testing", () => {
amount: [
{
denom,
amount: "100000",
amount: "1000000",
},
],
gas: "550000",
Expand Down

0 comments on commit c9f468e

Please sign in to comment.