From 1fe6c17e3a5c4b1bea33261024d1a5ecc7d26784 Mon Sep 17 00:00:00 2001 From: Simon Warta Date: Tue, 7 Jun 2022 22:55:37 +0200 Subject: [PATCH 1/3] CReate lint and build job using GH Actions --- .github/workflows/ci.yml | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..de045e3 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,28 @@ +on: + # Push to long living branches or PRs + push: + branches: + - main + pull_request: + +jobs: + lint: + runs-on: ubuntu-20.04 + steps: + - uses: actions/checkout@v2 + - name: Setup Node.js + uses: actions/setup-node@v2 + with: + node-version: '16' + - run: npm install + - run: npm run lint + build: + runs-on: ubuntu-20.04 + steps: + - uses: actions/checkout@v2 + - name: Setup Node.js + uses: actions/setup-node@v2 + with: + node-version: '16' + - run: npm install + - run: npm run build From 7935a3a9e535f955ba407ff0d08d75efabf7d1cc Mon Sep 17 00:00:00 2001 From: Simon Warta Date: Tue, 7 Jun 2022 23:01:32 +0200 Subject: [PATCH 2/3] Adapt code to make lint and build steps pass --- components/chainSelect/ChainSelect.js | 2 +- components/forms/TransactionSigning.js | 13 +++++++------ pages/multi/[address]/index.js | 2 +- 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/components/chainSelect/ChainSelect.js b/components/chainSelect/ChainSelect.js index 372dbf7..01c1440 100644 --- a/components/chainSelect/ChainSelect.js +++ b/components/chainSelect/ChainSelect.js @@ -33,7 +33,7 @@ const ChainSelect = () => { const [tempRegistryName, setRegistryName] = useState(state.chain.registryName); const [tempExplorerLink, setExplorerLink] = useState(state.chain.explorerLink); - let url = "https://api.github.com/repos/cosmos/chain-registry/contents"; + const url = "https://api.github.com/repos/cosmos/chain-registry/contents"; useEffect(() => { getGhJson(); diff --git a/components/forms/TransactionSigning.js b/components/forms/TransactionSigning.js index 0dba118..1327fa4 100644 --- a/components/forms/TransactionSigning.js +++ b/components/forms/TransactionSigning.js @@ -1,7 +1,7 @@ import React, { useState } from "react"; import axios from "axios"; import { toBase64 } from "@cosmjs/encoding"; -import { assertIsDeliverTxFailure, SigningStargateClient } from "@cosmjs/stargate"; +import { SigningStargateClient } from "@cosmjs/stargate"; import { assert } from "@cosmjs/utils"; import { useAppContext } from "../../context/AppContext"; @@ -38,7 +38,7 @@ const TransactionSigning = (props) => { const connectLedger = async () => { // Prepare ledger - const ledgerTransport = await TransportWebUSB.create(120_000, 120_000); + const ledgerTransport = await TransportWebUSB.create(120000, 120000); // Setup signer const offlineSigner = new LedgerSigner(ledgerTransport, { @@ -61,10 +61,11 @@ const TransactionSigning = (props) => { const signTransaction = async () => { const offlineSigner = walletType === "keplr" ? window.getOfflineSignerOnlyAmino(state.chain.chainId) : ledgerSigner; - - const signerAddress = walletType === "keplr" - ? walletAccount.bech32Address - : (await ledgerSigner.getAccounts())[0]?.address; + + const signerAddress = + walletType === "keplr" + ? walletAccount.bech32Address + : (await ledgerSigner.getAccounts())[0]?.address; assert(signerAddress, "Missing signer address"); const signingClient = await SigningStargateClient.offline(offlineSigner); diff --git a/pages/multi/[address]/index.js b/pages/multi/[address]/index.js index e6333f4..39ae39b 100644 --- a/pages/multi/[address]/index.js +++ b/pages/multi/[address]/index.js @@ -23,7 +23,7 @@ function participantAddressesFromMultisig(multisigPubkey, addressPrefix) { ); } -const multipage = (props) => { +const multipage = (_props) => { const { state } = useAppContext(); const [showTxForm, setShowTxForm] = useState(false); const [holdings, setHoldings] = useState(""); From dbcb131da93722b8982420ad5505377faee4bd8b Mon Sep 17 00:00:00 2001 From: Simon Warta Date: Tue, 7 Jun 2022 23:21:47 +0200 Subject: [PATCH 3/3] Deactivate build job --- .github/workflows/ci.yml | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index de045e3..99606a4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -16,13 +16,14 @@ jobs: node-version: '16' - run: npm install - run: npm run lint - build: - runs-on: ubuntu-20.04 - steps: - - uses: actions/checkout@v2 - - name: Setup Node.js - uses: actions/setup-node@v2 - with: - node-version: '16' - - run: npm install - - run: npm run build + # Fix and re-activate after https://github.com/cosmos/cosmos-multisig-ui/pull/61 + # build: + # runs-on: ubuntu-20.04 + # steps: + # - uses: actions/checkout@v2 + # - name: Setup Node.js + # uses: actions/setup-node@v2 + # with: + # node-version: '16' + # - run: npm install + # - run: npm run build