diff --git a/.github/workflows/e2e-tests.yaml b/.github/workflows/e2e-tests.yaml index 1192c7e9..b9cd6abe 100644 --- a/.github/workflows/e2e-tests.yaml +++ b/.github/workflows/e2e-tests.yaml @@ -31,11 +31,10 @@ jobs: - name: Set Up Starship Infrastructure id: starship-infra - uses: cosmology-tech/starship-action@0.3.0 + uses: cosmology-tech/starship-action@0.5.3 with: - values: packages/osmojs/starship/configs/config.workflow.yaml - port-forward: true - version: 0.2.3 + config: packages/osmojs/starship/configs/config.workflow.yaml + version: 0.2.5 - name: Run E2E Tests run: cd ./packages/osmojs && yarn starship:test diff --git a/packages/osmojs/package.json b/packages/osmojs/package.json index 2f793dcf..1039527f 100644 --- a/packages/osmojs/package.json +++ b/packages/osmojs/package.json @@ -46,8 +46,8 @@ "@protobufs/ibc": "^0.1.0", "@protobufs/osmosis": "^0.4.0", "@protobufs/tendermint": "^0.0.10", - "@starship-ci/cli": "^2.1.0", - "starshipjs": "^2.1.0" + "@starship-ci/cli": "^2.7.0", + "starshipjs": "^2.3.0" }, "dependencies": { "@cosmjs/amino": "0.32.3", diff --git a/packages/osmojs/starship/__tests__/gov.test.ts b/packages/osmojs/starship/__tests__/gov.test.ts index 3052750c..7a3fd302 100644 --- a/packages/osmojs/starship/__tests__/gov.test.ts +++ b/packages/osmojs/starship/__tests__/gov.test.ts @@ -20,8 +20,8 @@ import { waitUntil } from '../src'; describe('Governance tests for osmosis', () => { let protoSigner, aminoSigner, denom, address; let chainInfo: ChainInfo; - let getCoin: () => Asset; - let getRpcEndpoint: () => string; + let getCoin: () => Promise; + let getRpcEndpoint: () => Promise; let creditFromFaucet: (address: string, denom?: string | null) => Promise; // Variables used accross testcases @@ -38,7 +38,7 @@ describe('Governance tests for osmosis', () => { getRpcEndpoint, creditFromFaucet } = useChain('osmosis')); - denom = getCoin().base; + denom = (await getCoin()).base; const mnemonic = generateMnemonic(); // Initialize wallet @@ -52,7 +52,7 @@ describe('Governance tests for osmosis', () => { // Create custom cosmos interchain client queryClient = await cosmos.ClientFactory.createRPCQueryClient({ - rpcEndpoint: getRpcEndpoint() + rpcEndpoint: (await getRpcEndpoint()) }); // Transfer osmosis to address @@ -89,7 +89,7 @@ describe('Governance tests for osmosis', () => { it('stake tokens to genesis validator', async () => { const signingClient = await getSigningOsmosisClient({ - rpcEndpoint: getRpcEndpoint(), + rpcEndpoint: await getRpcEndpoint(), signer: protoSigner }); @@ -126,7 +126,7 @@ describe('Governance tests for osmosis', () => { it('submit a txt proposal', async () => { const signingClient = await getSigningCosmosClient({ - rpcEndpoint: getRpcEndpoint(), + rpcEndpoint: await getRpcEndpoint(), signer: protoSigner }); @@ -189,7 +189,7 @@ describe('Governance tests for osmosis', () => { it('vote on proposal from address', async () => { // create genesis address signing client const signingClient = await getSigningCosmosClient({ - rpcEndpoint: getRpcEndpoint(), + rpcEndpoint: await getRpcEndpoint(), signer: protoSigner }); diff --git a/packages/osmojs/starship/__tests__/pools.test.ts b/packages/osmojs/starship/__tests__/pools.test.ts index a6685fcb..069714d3 100644 --- a/packages/osmojs/starship/__tests__/pools.test.ts +++ b/packages/osmojs/starship/__tests__/pools.test.ts @@ -16,8 +16,8 @@ describe('Pool testing over IBC tokens', () => { let protoSigner, aminoSigner, denom, address; let chainInfo: ChainInfo; - let getCoin: () => Asset; - let getRpcEndpoint: () => string; + let getCoin: () => Promise; + let getRpcEndpoint: () => Promise; let creditFromFaucet: (address: string, denom?: string | null) => Promise; // Variables used accross testcases @@ -33,7 +33,7 @@ describe('Pool testing over IBC tokens', () => { getRpcEndpoint, creditFromFaucet } = useChain('osmosis')); - denom = getCoin().base; + denom = (await getCoin()).base; const mnemonic = generateMnemonic(); // Initialize wallet @@ -51,7 +51,7 @@ describe('Pool testing over IBC tokens', () => { }, 200000); it('check address has tokens', async () => { - const client = await StargateClient.connect(getRpcEndpoint()); + const client = await StargateClient.connect(await getRpcEndpoint()); const balances = await client.getAllBalances(address); expect(balances.length).toEqual(2); @@ -62,7 +62,7 @@ describe('Pool testing over IBC tokens', () => { it('create ibc pools with ibc atom osmo', async () => { const signingClient = await getSigningOsmosisClient({ - rpcEndpoint: getRpcEndpoint(), + rpcEndpoint: await getRpcEndpoint(), signer: protoSigner }); @@ -128,10 +128,10 @@ describe('Pool testing over IBC tokens', () => { it('query pool via id, verify creation', async () => { // Query the created pool const queryClient = await osmosis.ClientFactory.createRPCQueryClient({ - rpcEndpoint: getRpcEndpoint() + rpcEndpoint: await getRpcEndpoint() }); - const client = await StargateClient.connect(getRpcEndpoint()); + const client = await StargateClient.connect(await getRpcEndpoint()); const poolResponse = await queryClient.osmosis.gamm.v1beta1.pool({ poolId @@ -160,7 +160,7 @@ describe('Pool testing over IBC tokens', () => { it('join pool', async () => { const signingClient = await getSigningOsmosisClient({ - rpcEndpoint: getRpcEndpoint(), + rpcEndpoint: await getRpcEndpoint(), signer: aminoSigner }); @@ -208,7 +208,7 @@ describe('Pool testing over IBC tokens', () => { it('lock tokens', async () => { const signingClient = await getSigningOsmosisClient({ - rpcEndpoint: getRpcEndpoint(), + rpcEndpoint: await getRpcEndpoint(), signer: aminoSigner }); @@ -251,7 +251,7 @@ describe('Pool testing over IBC tokens', () => { it('swap tokens using pool, to address without ibc token', async () => { const signingClient = await getSigningOsmosisClient({ - rpcEndpoint: getRpcEndpoint(), + rpcEndpoint: await getRpcEndpoint(), signer: aminoSigner }); diff --git a/packages/osmojs/starship/__tests__/setup.test.ts b/packages/osmojs/starship/__tests__/setup.test.ts index cbdc473e..9c4fe3f2 100644 --- a/packages/osmojs/starship/__tests__/setup.test.ts +++ b/packages/osmojs/starship/__tests__/setup.test.ts @@ -14,7 +14,7 @@ describe('Test clients', () => { beforeAll(async () => { const { getRpcEndpoint } = useChain('osmosis'); - client = await StargateClient.connect(getRpcEndpoint()); + client = await StargateClient.connect(await getRpcEndpoint()); }); it('check chain height', async () => { diff --git a/packages/osmojs/starship/__tests__/staking.test.ts b/packages/osmojs/starship/__tests__/staking.test.ts index 3f1da04d..4d12edb2 100644 --- a/packages/osmojs/starship/__tests__/staking.test.ts +++ b/packages/osmojs/starship/__tests__/staking.test.ts @@ -24,7 +24,7 @@ describe('Staking tokens testing', () => { getRpcEndpoint, creditFromFaucet } = useChain('osmosis')); - denom = getCoin().base; + denom = (await getCoin()).base; // Initialize wallet wallet = await DirectSecp256k1HdWallet.fromMnemonic(generateMnemonic(), { @@ -34,7 +34,7 @@ describe('Staking tokens testing', () => { // Create custom cosmos interchain client queryClient = await cosmos.ClientFactory.createRPCQueryClient({ - rpcEndpoint: getRpcEndpoint() + rpcEndpoint: await getRpcEndpoint() }); // Transfer osmosis and ibc tokens to address, send only osmo to address @@ -71,7 +71,7 @@ describe('Staking tokens testing', () => { it('stake tokens to genesis validator', async () => { const signingClient = await getSigningOsmosisClient({ - rpcEndpoint: getRpcEndpoint(), + rpcEndpoint: await getRpcEndpoint(), signer: wallet }); diff --git a/packages/osmojs/starship/__tests__/token.test.ts b/packages/osmojs/starship/__tests__/token.test.ts index 97045f66..0bfb780f 100644 --- a/packages/osmojs/starship/__tests__/token.test.ts +++ b/packages/osmojs/starship/__tests__/token.test.ts @@ -18,7 +18,7 @@ describe('Token transfers', () => { getRpcEndpoint, creditFromFaucet } = useChain('osmosis')); - denom = getCoin().base; + denom = (await getCoin()).base; // Initialize wallet wallet = await DirectSecp256k1HdWallet.fromMnemonic(generateMnemonic(), { @@ -38,7 +38,7 @@ describe('Token transfers', () => { const address2 = (await wallet2.getAccounts())[0].address; const signingClient = await getSigningOsmosisClient({ - rpcEndpoint: getRpcEndpoint(), + rpcEndpoint: await getRpcEndpoint(), signer: wallet }); @@ -74,7 +74,7 @@ describe('Token transfers', () => { it('send ibc osmo tokens to address on cosmos chain', async () => { const signingClient = await getSigningOsmosisClient({ - rpcEndpoint: getRpcEndpoint(), + rpcEndpoint: await getRpcEndpoint(), signer: wallet }); @@ -95,12 +95,12 @@ describe('Token transfers', () => { const cosmosAddress = (await cosmosWallet.getAccounts())[0].address; const ibcInfos = chainInfo.fetcher.getChainIbcData( - chainInfo.chain.chain_id + chainInfo.chain.chain_name ); const ibcInfo = ibcInfos.find( (i) => - i.chain_1.chain_name === chainInfo.chain.chain_id && - i.chain_2.chain_name === cosmosChainInfo.chain.chain_id + i.chain_1.chain_name === chainInfo.chain.chain_name && + i.chain_2.chain_name === cosmosChainInfo.chain.chain_name ); expect(ibcInfo).toBeTruthy(); @@ -142,7 +142,7 @@ describe('Token transfers', () => { assertIsDeliverTxSuccess(resp); // Check osmos in address on cosmos chain - const cosmosClient = await StargateClient.connect(cosmosRpcEndpoint()); + const cosmosClient = await StargateClient.connect(await cosmosRpcEndpoint()); const balances = await cosmosClient.getAllBalances(cosmosAddress); // check balances @@ -157,7 +157,7 @@ describe('Token transfers', () => { // check ibc denom trace of the same const queryClient = await ibc.ClientFactory.createRPCQueryClient({ - rpcEndpoint: cosmosRpcEndpoint() + rpcEndpoint: await cosmosRpcEndpoint() }); const trace = await queryClient.ibc.applications.transfer.v1.denomTrace({ // @ts-ignore diff --git a/packages/osmojs/starship/configs/starship.yaml b/packages/osmojs/starship/configs/starship.yaml index 6106cff8..1f9f4976 100644 --- a/packages/osmojs/starship/configs/starship.yaml +++ b/packages/osmojs/starship/configs/starship.yaml @@ -1,3 +1,3 @@ helmName: osmojs helmFile: ./config.yaml -helmVersion: v0.2.3 +helmVersion: v0.2.5 diff --git a/packages/osmojs/starship/src/utils.ts b/packages/osmojs/starship/src/utils.ts index 3448cbb8..dd510499 100644 --- a/packages/osmojs/starship/src/utils.ts +++ b/packages/osmojs/starship/src/utils.ts @@ -42,8 +42,8 @@ export const transferIbcTokens = async (fromChain: string, toChain: string, toAd await fromChainData.creditFromFaucet(fromAddress); - const fromClient = await setupIbcClient(fromChainData.getRpcEndpoint(), wallet); - const token = { denom: fromChainData.getCoin().base, amount }; + const fromClient = await setupIbcClient(await fromChainData.getRpcEndpoint(), wallet); + const token = { denom: (await fromChainData.getCoin()).base, amount }; const resp = await sendIbcTokens(fromClient, fromAddress, toAddress, token, ibcInfo, amount); @@ -53,10 +53,10 @@ export const transferIbcTokens = async (fromChain: string, toChain: string, toAd const findIbcInfo = (chainInfo: ChainInfo, toChainInfo: ChainInfo) => { const registry = ConfigContext.registry; - const ibcInfos = registry!.getChainIbcData(chainInfo.chain.chain_id); + const ibcInfos = registry!.getChainIbcData(chainInfo.chain.chain_name); const found = ibcInfos.find( - i => i.chain_1.chain_name === chainInfo.chain.chain_id && - i.chain_2.chain_name === toChainInfo.chain.chain_id + i => i.chain_1.chain_name === chainInfo.chain.chain_name && + i.chain_2.chain_name === toChainInfo.chain.chain_name ); if (!found) throw new Error('Cannot find IBC info'); return found; diff --git a/yarn.lock b/yarn.lock index 02ac274f..9a5a9e65 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2516,22 +2516,22 @@ dependencies: "@sinonjs/commons" "^3.0.0" -"@starship-ci/cli@^2.1.0": - version "2.1.0" - resolved "https://registry.yarnpkg.com/@starship-ci/cli/-/cli-2.1.0.tgz#4e469edf6dceea42fe9a9ed92e4f35b167438e82" - integrity sha512-rngL4hWQyHwJjnMd1UfsP2IcCKsBJUw7zHf2V1cwq8NRS7g7FRkWSSbyCN1F6LjIEbuP216eI1/qwnNDd56bwQ== +"@starship-ci/cli@^2.7.0": + version "2.7.0" + resolved "https://registry.yarnpkg.com/@starship-ci/cli/-/cli-2.7.0.tgz#706a90ae6f3e3e1c784b28fe260e9388dbe95c83" + integrity sha512-gcLT0hA/wQJtidHZiIb1ICgJtF2ISSpiUVb/3dGU/1tBYKKOgYMuTkmTUOnocGI3QdkAwOB+7Rlw0BeH4fieFg== dependencies: - "@starship-ci/client" "^2.1.0" + "@starship-ci/client" "^2.7.0" chalk "^4.1.0" deepmerge "^4.3.1" inquirerer "^1.9.0" js-yaml "^4.1.0" minimist "^1.2.8" -"@starship-ci/client@^2.1.0": - version "2.1.0" - resolved "https://registry.yarnpkg.com/@starship-ci/client/-/client-2.1.0.tgz#e316af56a7055c198c71104d9d58df6f02dd80bc" - integrity sha512-n8l+bpSGW86fHKpbmP6JGCJxJ2mDzsF6Dm40YUx9FZW44qrjiFVy4eJ67xL8psQ8e3367mSuduFbvdnNUZvzOQ== +"@starship-ci/client@^2.7.0": + version "2.7.0" + resolved "https://registry.yarnpkg.com/@starship-ci/client/-/client-2.7.0.tgz#b85fce50267b909a11eeed6e3ff8f45b318b505a" + integrity sha512-xoo5Feu0MxT5yCg9dDBsxN/Tl/GRazAMEAsPtHSFTBf7FokGMGmFgkcuXR4g2VSTy6qmHC69iKQORIlhir9s2g== dependencies: chalk "^4.1.0" deepmerge "^4.3.1" @@ -8313,10 +8313,10 @@ stack-utils@^2.0.3: dependencies: escape-string-regexp "^2.0.0" -starshipjs@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/starshipjs/-/starshipjs-2.1.0.tgz#6e3462af8d8b3eaadbed37e236c9e00f99f5cfc5" - integrity sha512-z41NLSnBlCZ1yarcwgMFYioJYHiLZ2hMF9qvqmvg0vJ8lyVfWCRYYDYFFtZTcjKsbZgiayW6vP7HLRMqYq1c7g== +starshipjs@^2.3.0: + version "2.3.0" + resolved "https://registry.yarnpkg.com/starshipjs/-/starshipjs-2.3.0.tgz#074a0aae279a8ca589e0aeddf823fe2f7854fb29" + integrity sha512-XdHMuyDXVeZe63GawkD71xKXuuXH2MQ12Qr3p5XbYoMfP6TsVvgwf5g5hE9KJ6lYR2uXXhjL5DaVZPGyvku7hA== dependencies: "@chain-registry/client" "1.18.1" bip39 "^3.1.0"