From 1e6996ddc1f41fa4d95ac55d0767bec986c39d44 Mon Sep 17 00:00:00 2001 From: Aaron DeRuvo Date: Thu, 21 Mar 2024 15:55:07 +0300 Subject: [PATCH] and we have a pass --- .gitignore | 1 + packages/cli/.gitignore | 1 + .../src/commands/governance/propose.test.ts | 32 ++++++------------- .../cli/src/commands/governance/propose.ts | 3 +- packages/cli/transactions2.json | 1 - packages/sdk/explorer/src/block-explorer.ts | 1 - 6 files changed, 13 insertions(+), 26 deletions(-) delete mode 100644 packages/cli/transactions2.json diff --git a/.gitignore b/.gitignore index 9b32745dc..9f5bd6e0a 100644 --- a/.gitignore +++ b/.gitignore @@ -92,3 +92,4 @@ package.json-e # Ignore generated credentials from google-github-actions/auth gha-creds-*.json transactions.json +transactions2.json diff --git a/packages/cli/.gitignore b/packages/cli/.gitignore index d9e7a3389..5f3bad558 100644 --- a/packages/cli/.gitignore +++ b/packages/cli/.gitignore @@ -10,3 +10,4 @@ oclif.manifest.json src/generated .devchain/ .devchain.tar.gz +transactions2.json diff --git a/packages/cli/src/commands/governance/propose.test.ts b/packages/cli/src/commands/governance/propose.test.ts index 2d1ded236..b358bc9eb 100644 --- a/packages/cli/src/commands/governance/propose.test.ts +++ b/packages/cli/src/commands/governance/propose.test.ts @@ -1,4 +1,4 @@ -import { Address } from '@celo/connect' +import { StrongAddress } from '@celo/base' import { newKitFromWeb3 } from '@celo/contractkit' import { GoldTokenWrapper } from '@celo/contractkit/lib/wrappers/GoldTokenWrapper' import { GovernanceWrapper } from '@celo/contractkit/lib/wrappers/Governance' @@ -144,10 +144,10 @@ testWithGanache('governance:propose cmd', (web3: Web3) => { const minDeposit = web3.utils.toWei(expConfig.minDeposit.toString(), 'ether') const kit = newKitFromWeb3(web3) - let accounts: Address[] = [] + let accounts: StrongAddress[] = [] beforeEach(async () => { - accounts = await web3.eth.getAccounts() + accounts = (await web3.eth.getAccounts()) as StrongAddress[] kit.defaultAccount = accounts[0] governance = await kit.contracts.getGovernance() goldToken = await kit.contracts.getGoldToken() @@ -360,25 +360,11 @@ testWithGanache('governance:propose cmd', (web3: Web3) => { const transactionsForContractsVerifiedOnCeloScan = [ { - contract: '0xFa3df877F98ac5ecd87456a7AcCaa948462412f0', - address: '0xFa3df877F98ac5ecd87456a7AcCaa948462412f0', - function: 'removeLiquidity(uint256,uint256[],uint256)', - args: ['10000000000000000000000000', ['0', '0'], 1674883684], - value: '0', - }, - { - contract: '0x765de816845861e75a25fca122bb6898b8b1282a', - address: '0x765de816845861e75a25fca122bb6898b8b1282a', - function: 'approve(address,uint256)', - args: ['0x87647780180B8f55980C7D3fFeFe08a9B29e9aE1', '11000000000000000000000000'], - value: '0', - }, - { - contract: '0x37f750B7cC259A2f741AF45294f6a16572CF5cAd', - address: '0x37f750B7cC259A2f741AF45294f6a16572CF5cAd', - function: 'approve(address,uint256)', - args: ['0x87647780180B8f55980C7D3fFeFe08a9B29e9aE1', '11000000000000'], - value: '0', + contract: 'Vyper_contract', + address: '0xf4cab10dC19695AaCe14b7A16d7705b600ad5F73', + function: 'transfer(address,uint256)', + args: ['0x87647780180B8f55980C7D3fFeFe08a9B29e9aE1', '20001239154911011864219072'], + value: 0, }, ] @@ -402,7 +388,7 @@ testWithGanache('governance:propose cmd', (web3: Web3) => { '--deposit', '1000000000000000000', '--from', - accounts[0], + accounts[0] as StrongAddress, '--descriptionURL', 'https://example.com', ]) diff --git a/packages/cli/src/commands/governance/propose.ts b/packages/cli/src/commands/governance/propose.ts index f6af87c1b..4fa0e2e73 100644 --- a/packages/cli/src/commands/governance/propose.ts +++ b/packages/cli/src/commands/governance/propose.ts @@ -1,3 +1,4 @@ +import { StrongAddress } from '@celo/base' import { ProposalBuilder, proposalToJSON, ProposalTransactionJSON } from '@celo/governance' import { Flags } from '@oclif/core' import { BigNumber } from 'bignumber.js' @@ -52,7 +53,7 @@ export default class Propose extends BaseCommand { const res = await this.parse(Propose) const account = res.flags.from const deposit = new BigNumber(res.flags.deposit) - kit.defaultAccount = account + kit.defaultAccount = account as StrongAddress await newCheckBuilder(this, account) .hasEnoughCelo(account, deposit) diff --git a/packages/cli/transactions2.json b/packages/cli/transactions2.json deleted file mode 100644 index 43cc7eaf8..000000000 --- a/packages/cli/transactions2.json +++ /dev/null @@ -1 +0,0 @@ -[{"contract":"0x765de816845861e75a25fca122bb6898b8b1282a","address":"0x765de816845861e75a25fca122bb6898b8b1282a","function":"approve(address,uint256)","args":["0x87647780180B8f55980C7D3fFeFe08a9B29e9aE1","11000000000000000000000000"],"value":"0"},{"contract":"0x37f750B7cC259A2f741AF45294f6a16572CF5cAd","address":"0x37f750B7cC259A2f741AF45294f6a16572CF5cAd","function":"approve(address,uint256)","args":["0x87647780180B8f55980C7D3fFeFe08a9B29e9aE1","11000000000000"],"value":"0"}] \ No newline at end of file diff --git a/packages/sdk/explorer/src/block-explorer.ts b/packages/sdk/explorer/src/block-explorer.ts index 37b5940b9..bbfa1e0d4 100644 --- a/packages/sdk/explorer/src/block-explorer.ts +++ b/packages/sdk/explorer/src/block-explorer.ts @@ -386,7 +386,6 @@ export class BlockExplorer { ) } const mapping = metadata?.toContractMapping() - console.info('CS map', address) mapping?.fnMapping.forEach((selector) => { console.info(selector.name, JSON.stringify(selector)) })