Skip to content

Commit

Permalink
integration test: get block, tx, receipt, filter logs, code at
Browse files Browse the repository at this point in the history
  • Loading branch information
ramilexe committed Apr 19, 2021
1 parent 141b3ea commit 3c57fa1
Show file tree
Hide file tree
Showing 14 changed files with 879 additions and 80 deletions.
14 changes: 14 additions & 0 deletions docker-compose.test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
version: '3.2'

services:
contract:
depends_on:
- dapptools
build:
context: ./test/contract
args:
ETH_ADDR: "http://192.168.192.4:8545"
environment:
ETH_ADDR: "http://192.168.192.4:8545"
ports:
- "127.0.0.1:3000:3000"
6 changes: 6 additions & 0 deletions test/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@

Spin up services:
```
docker-compose -f docker-compose.test.yml -f ../docker-compose.yml up contract
```
3 changes: 3 additions & 0 deletions test/contract/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
node_modules
artifacts
cache
14 changes: 14 additions & 0 deletions test/contract/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
FROM node:14

ARG ETH_ADDR
ENV ETH_ADDR $ETH_ADDR

WORKDIR /usr/src/app
COPY package*.json ./
RUN npm ci
COPY . .
RUN npm run compile && ls -lah

EXPOSE 3000

ENTRYPOINT ["npm", "start"]
7 changes: 7 additions & 0 deletions test/contract/contracts/GLDToken.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
contract GLDToken is ERC20 {
constructor() ERC20("Gold", "GLD") {
_mint(msg.sender, 1000000000000000000000);
}
}
21 changes: 0 additions & 21 deletions test/contract/contracts/Greeter.sol

This file was deleted.

6 changes: 5 additions & 1 deletion test/contract/hardhat.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,15 @@ task("accounts", "Prints the list of accounts", async () => {
* @type import('hardhat/config').HardhatUserConfig
*/
module.exports = {
solidity: "0.7.3",
solidity: "0.8.0",
networks: {
local: {
url: 'http://127.0.0.1:8545',
chainId: 4
},
docker: {
url: process.env.ETH_ADDR,
chainId: 4
}
}
};
Expand Down
Loading

0 comments on commit 3c57fa1

Please sign in to comment.