diff --git a/Makefile b/Makefile index bfd70521e..22937f60b 100644 --- a/Makefile +++ b/Makefile @@ -221,8 +221,6 @@ test-integration-soak-ci: test-integration-contracts: build-ts env-devnet-hardhat echo "Tests currently broken because of starknet-hardhat-plugin" exit 1 - cd packages-ts/integration-multisig/ && \ - yarn test cd packages-ts/starknet/ && \ yarn test diff --git a/packages-ts/integration-multisig/hardhat.config.ts b/packages-ts/integration-multisig/hardhat.config.ts deleted file mode 100644 index 88fe0f990..000000000 --- a/packages-ts/integration-multisig/hardhat.config.ts +++ /dev/null @@ -1,41 +0,0 @@ -import path from 'path' -import { HardhatUserConfig } from 'hardhat/types' -import '@shardlabs/starknet-hardhat-plugin' -import { prepareHardhatArtifacts } from '../../contracts/test/setup' - -/** - * @type import('hardhat/config').HardhatUserConfig - */ -const config: HardhatUserConfig = { - starknet: { - venv: 'active', - network: 'devnet', - wallets: { - OpenZeppelin: { - accountName: 'OpenZeppelin', - modulePath: 'starkware.starknet.wallets.open_zeppelin.OpenZeppelinAccount', - accountPath: '~/.starknet_accounts', - }, - }, - }, - networks: { - devnet: { - url: 'http://127.0.0.1:5050/', - args: ['--cairo-compiler-manifest', '../../vendor/cairo/Cargo.toml'], - }, - }, - mocha: { - timeout: 10000000, - rootHooks: { - beforeAll: prepareHardhatArtifacts, - }, - }, - paths: { - sources: './solidity', - starknetSources: '../../contracts/src', - starknetArtifacts: '../../contracts/target/release', - cairoPaths: [], - }, -} - -export default config diff --git a/packages-ts/integration-multisig/package.json b/packages-ts/integration-multisig/package.json deleted file mode 100644 index bd2b8aeeb..000000000 --- a/packages-ts/integration-multisig/package.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "name": "@chainlink/starknet-integration-tests-multisig", - "version": "1.0.0", - "description": "Multisig integration test", - "main": "index.js", - "directories": { - "test": "test" - }, - "scripts": { - "test": "npx hardhat --network localhost test" - }, - "devDependencies": { - "@changesets/cli": "^2.22.0", - "@nomiclabs/hardhat-ethers": "^2.0.5", - "@shardlabs/starknet-hardhat-plugin": "^0.8.0-alpha.2", - "@types/chai": "^4.3.3", - "@types/elliptic": "^6.4.14", - "@types/mocha": "^9.1.1", - "chai": "^4.3.6", - "ethers": "^5.6.8", - "hardhat": "^2.16.1", - "starsign-multisig": "^0.3.0" - } -} diff --git a/packages-ts/integration-multisig/test/Multisig.test.ts b/packages-ts/integration-multisig/test/Multisig.test.ts deleted file mode 100644 index 47bb825ab..000000000 --- a/packages-ts/integration-multisig/test/Multisig.test.ts +++ /dev/null @@ -1,87 +0,0 @@ -import { expect } from 'chai' -import { starknet } from 'hardhat' -import { StarknetContract, Account } from 'hardhat/types/runtime' -import { num, hash } from 'starknet' -import { account, expectSuccessOrDeclared } from '@chainlink/starknet' - -describe('Multisig integration tests', function () { - this.timeout(300_000) - - const opts = account.makeFunderOptsFromEnv() - const funder = new account.Funder(opts) - - let account1: Account - let account2: Account - let account3: Account - - let multisig: StarknetContract - - before(async function () { - account1 = await starknet.OpenZeppelinAccount.createAccount() - account2 = await starknet.OpenZeppelinAccount.createAccount() - account3 = await starknet.OpenZeppelinAccount.createAccount() - - await funder.fund([ - { account: account1.address, amount: 1e21 }, - { account: account2.address, amount: 1e21 }, - { account: account3.address, amount: 1e21 }, - ]) - await account1.deployAccount() - await account2.deployAccount() - await account3.deployAccount() - }) - - it('Deploy contract', async () => { - let multisigFactory = await starknet.getContractFactory('multisig') - await expectSuccessOrDeclared(account1.declare(multisigFactory, { maxFee: 1e20 })) - - multisig = await account1.deploy(multisigFactory, { - signers: [ - num.toBigInt(account1.starknetContract.address), - num.toBigInt(account2.starknetContract.address), - num.toBigInt(account3.starknetContract.address), - ], - threshold: 2, - }) - - expect(multisig).to.be.ok - }) - - it('should submit & confirm transaction', async () => { - const nonce = 0 - const newThreshold = 1n - const selector = hash.getSelectorFromName('set_threshold') - - const payload = { - to: multisig.address, - function_selector: selector, - calldata: [newThreshold], - } - - { - const res = await account1.invoke(multisig, 'submit_transaction', payload) - const txReciept = await starknet.getTransactionReceipt(res) - - expect(txReciept.events.length).to.equal(2) - expect(txReciept.events[0].data.length).to.equal(3) - expect(txReciept.events[0].data[1]).to.equal(num.toHex(num.toBigInt(nonce, 'hex'))) - } - - await account1.invoke(multisig, 'confirm_transaction', { - nonce, - }) - - await account2.invoke(multisig, 'confirm_transaction', { - nonce, - }) - - await account3.invoke(multisig, 'execute_transaction', { - nonce, - }) - - { - const res = await multisig.call('get_threshold') - expect(res.response).to.equal(newThreshold) - } - }) -}) diff --git a/packages-ts/integration-multisig/tsconfig.json b/packages-ts/integration-multisig/tsconfig.json deleted file mode 100644 index 8ac80569b..000000000 --- a/packages-ts/integration-multisig/tsconfig.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "extends": "../../tsconfig.base.json", - "include": ["./test"], - "files": ["./hardhat.config.ts"] - } - \ No newline at end of file