Skip to content
This repository has been archived by the owner on Apr 4, 2024. It is now read-only.

Commit

Permalink
tests(filters): add/improve integration tests for JSON-RPC methods (#…
Browse files Browse the repository at this point in the history
…1480)

* tests(filters) add block hash check on newBlock filter

* tests(filters) add getLogs test cases

* tests(filters) add eth_newFilter multiple filters test cases

* tests(filters) add eth_newFilter and eth_eth_uninstallFilter test case

* tests(filters) fix linting errors

* tests(filters) fix linting error on imports

* tests(filters) add test case: register filter before contract deploy

* tests(filters) refactor logs topics assertion

* tests(filters) add topics filter test cases

* tests(filters) fix linting errors

* tests(filters) remove unnecessary package.json file

* tests(filters) update based on PR comments

* tests(filters) separate getNewBlocks failing test to a separate PR

* tests(filters) add retry on send_tx to avoid Timeout error

* tests(filters) add logs by topic and block range test case

* update gomod2nix

* tests(filters) remove test elapsed time log

Co-authored-by: Federico Kunze Küllmer <31522760+fedekunze@users.noreply.github.com>
Co-authored-by: Freddy Caceres <facs95@gmail.com>
  • Loading branch information
3 people authored Nov 30, 2022
1 parent b59dd75 commit ecd7639
Show file tree
Hide file tree
Showing 16 changed files with 1,846 additions and 586 deletions.
4 changes: 2 additions & 2 deletions gomod2nix.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ schema = 3
version = "v1.0.0-beta.7"
hash = "sha256-XblGvIx6Wvvq6wggXjp+KbeJGXoe7AZH7hXEdauCezU="
[mod."cosmossdk.io/math"]
version = "v1.0.0-beta.3"
hash = "sha256-lTQ27ZlL+kWlc+S//sJmyiOwaf9qS+YLv61I4OXi9XE="
version = "v1.0.0-beta.4"
hash = "sha256-UYdq/46EubyjxkldGike8FlwJLWGCB576VB7th285ao="
[mod."filippo.io/edwards25519"]
version = "v1.0.0-rc.1"
hash = "sha256-3DboBqby2ejRU33FG96Z8JF5AJ8HP2rC/v++VyoQ2LQ="
Expand Down
2 changes: 1 addition & 1 deletion scripts/run-integration-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ cd "$(dirname "$0")"
export TMPDIR=/tmp

echo "build test contracts"
cd ../tests/integration_tests/contracts
cd ../tests/integration_tests/hardhat
HUSKY_SKIP_INSTALL=1 npm install
npm run typechain
cd ..
Expand Down
9 changes: 0 additions & 9 deletions tests/integration_tests/contracts/contracts/TestERC20A.sol

This file was deleted.

25 changes: 25 additions & 0 deletions tests/integration_tests/hardhat/contracts/Mars.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
// SPDX-License-Identifier: MIT
pragma solidity 0.8.10;

import "@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol";
import "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";
import "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol";

contract Mars is Initializable, ERC20Upgradeable, UUPSUpgradeable, OwnableUpgradeable {
function initialize() public initializer {
__ERC20_init("Mars", "MRS");
__Ownable_init();
_mint(msg.sender, 1000000 * 10 ** decimals());
}

function _authorizeUpgrade(address newImplementation) internal
override
onlyOwner {}
}

contract MarsV2 is Mars {
function version() pure public returns (string memory) {
return "v2";
}
}
10 changes: 10 additions & 0 deletions tests/integration_tests/hardhat/contracts/TestERC20A.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
// SPDX-License-Identifier: MIT
pragma solidity 0.8.10;

import "@openzeppelin/contracts/token/ERC20/ERC20.sol";

contract TestERC20A is ERC20 {
constructor() public ERC20("TestERC20", "Test") {
_mint(msg.sender, 100000000000000000000000000);
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import { HardhatUserConfig } from "hardhat/config";
import type { HardhatUserConfig } from "hardhat/config";
import "hardhat-typechain";
import "@openzeppelin/hardhat-upgrades";
import "@nomiclabs/hardhat-ethers";

const config: HardhatUserConfig = {
solidity: {
Expand Down
Loading

0 comments on commit ecd7639

Please sign in to comment.