Giter Site home page Giter Site logo

bodhi.js's Introduction

Acala EVM+ SDKs

These are some tools and SDKs related to Acala EVM+. It also contains some examples about how to interact with EVM+ with these tools.

Packages:

Getting Started

  • initialize submodules (only need to do once after git clone)
git submodule update --init --recursive
  • install all dependencies
yarn
  • build
yarn build
  • run tests
yarn test

e2e-tests

# build the bodhi-runner image
docker build . -t bodhi-runner -f docker/bodhi-runner.Dockerfile
yarn e2e:eth-providers
yarn e2e:eth-rpc-adapter
yarn e2e:waffle
yarn e2e:hardhat
yarn e2e:truffle

Run Tests

with docker

  • clean up
docker compose down -v
  • run tests
## build the bodhi-runner image
docker build . -t bodhi-runner -f docker/bodhi-runner.Dockerfile

## run any test
docker compose up --abort-on-container-exit --exit-code-from=xxx --build -- xxx

where xxx ∈ {
  eth-providers-test,
  eth-rpc-adapter-test,
  waffle-examples-test,
  hardhat-tutorials-test,
  truffle-tutorials-test,
}

## run all tests (not recommended since log will be too messy)
docker compose up

we can grep container logs by

docker compose logs --tail=0 --follow   # all logs
docker logs -f <container_id>           # logs for specific container

Docker Images

  • eth-rpc-adapoter
    • build locally: docker build . -t eth-rpc-local -f packages/eth-rpc-adapter/Dockerfile
    • public docker images
  • evm subquery
    • build locally: docker build . -t evm-subql-local -f packages/evm-subql/Dockerfile
    • public docker images

More References

CI

To release new NPN packages then first bump versions and commit. Use prerelease for beta releases

yarn bump <patch, minor, major, prerelease>
git add .
git commit -m "bump v2.x.x"

To release docker images then tag the commit and push. Use manual workflow_dispatch for beta releasees

git tag v2.x.x
git push --atomic origin master v2.x.x

bodhi.js's People

Contributors

shunjizhan avatar ntduan avatar actions-user avatar zjb0807 avatar ermalkaleci avatar dependabot[bot] avatar xlc avatar hussainmehdi avatar thunderdeliverer avatar gluneau avatar jamcarbon avatar stwiname avatar brettkolodny avatar eliasmpw avatar

Stargazers

Leechael avatar Qiwei Yang avatar Haruki Kondo avatar Crypto Wolf ◾️ avatar dzmitry-lahoda avatar Tomasz Waszczyk avatar codeshwar avatar Yujun Zhang avatar Anbang avatar fis avatar  avatar Alireza (0xAlireza) avatar  avatar Alec WM avatar misoobu avatar  avatar Yan-Tong Lin avatar Cheng JIANG avatar  avatar  avatar Sutiliza.org avatar  avatar  avatar Luke Schoen avatar Matej yangwao avatar Will Pankiewicz avatar  avatar 0xThreeBody avatar

Watchers

Ruitao Su avatar James Cloos avatar  avatar  avatar  avatar  avatar  avatar codeshwar avatar Sutiliza.org avatar  avatar

bodhi.js's Issues

TransactionReceipt Type Definition Polish

as discussed in #99, in order to comply with the TransactionReceipt type definition in @etherpoject, we had to made a couple compromise. For example, we now use a default 0x address instead of a null for TransactionReceipt.to for contract creation.

We will leave it as it is now, and fix it if something complains

state-rent example test failure

 0 passing (9s)
  1 failing

  1) StateRent
       stateRent works:
     Error: -32603: execution fatal: Module { index: 180, error: 2, message: Some("NoPermission") }
      at RpcCoder._checkError (/Users/shunjizhan/Acala/bodhi.js/common/temp/node_modules/.pnpm/@[email protected]/node_modules/@polkadot/rpc-provider/coder/index.cjs:84:13)
      at RpcCoder.decodeResponse (/Users/shunjizhan/Acala/bodhi.js/common/temp/node_modules/.pnpm/@[email protected]/node_modules/@polkadot/rpc-provider/coder/index.cjs:47:10)
      at WsProvider.value (/Users/shunjizhan/Acala/bodhi.js/common/temp/node_modules/.pnpm/@[email protected]/node_modules/@polkadot/rpc-provider/ws/index.cjs:260:90)
      at W3CWebSocket.value [as onmessage] (/Users/shunjizhan/Acala/bodhi.js/common/temp/node_modules/.pnpm/@[email protected]/node_modules/@polkadot/rpc-provider/ws/index.cjs:240:153)
      at W3CWebSocket._dispatchEvent [as dispatchEvent] (/Users/shunjizhan/Acala/bodhi.js/common/temp/node_modules/.pnpm/[email protected]/node_modules/yaeti/lib/EventTarget.js:107:17)
      at W3CWebSocket.onMessage (/Users/shunjizhan/Acala/bodhi.js/common/temp/node_modules/.pnpm/[email protected]/node_modules/websocket/lib/W3CWebSocket.js:234:14)
      at WebSocketConnection.<anonymous> (/Users/shunjizhan/Acala/bodhi.js/common/temp/node_modules/.pnpm/[email protected]/node_modules/websocket/lib/W3CWebSocket.js:205:19)
      at WebSocketConnection.EventEmitter.emit (domain.js:467:12)
      at WebSocketConnection.processFrame (/Users/shunjizhan/Acala/bodhi.js/common/temp/node_modules/.pnpm/[email protected]/node_modules/websocket/lib/WebSocketConnection.js:554:26)
      at /Users/shunjizhan/Acala/bodhi.js/common/temp/node_modules/.pnpm/[email protected]/node_modules/websocket/lib/WebSocketConnection.js:323:40
      at processTicksAndRejections (internal/process/task_queues.js:75:11)

only EIP-155 transactions are supported. but get unknown not implemented

This was deploying yesterday, not today. Ideas?

hardhat npx hardhat run scripts/sample-script.js --network development
ProviderError: only EIP-155 transactions are supported. but get unknown not implemented (method="only EIP-155 transactions are supported. but get unknown", provider="eth-providers", code=NOT_IMPLEMENTED, version=bodhi.js/providers/2.1.3)
    at HttpProvider.request (/home/acala/hardhat/node_modules/hardhat/src/internal/core/providers/http.ts:49:19)
    at LocalAccountsProvider.request (/home/acala/hardhat/node_modules/hardhat/src/internal/core/providers/accounts.ts:181:36)
    at processTicksAndRejections (internal/process/task_queues.js:95:5)
    at EthersProviderWrapper.send (/home/acala/hardhat/node_modules/@nomiclabs/hardhat-ethers/src/internal/ethers-provider-wrapper.ts:13:20

RPC side:

[1637703396205] DEBUG (907699 on XPS-15-7590): incoming request
    jsonrpc: "2.0"
    method: "eth_sendRawTransaction"
    params: [
      "0xf90...f2fb"
    ]
    id: 11
[1637703396235] DEBUG (907699 on XPS-15-7590): request completed
    id: 11
    jsonrpc: "2.0"
    error: {
      "code": -32601,
      "message": "only EIP-155 transactions are supported. but get unknown not implemented (method=\"only EIP-155 transactions are supported. but get unknown\", provider=\"eth-providers\", code=NOT_IMPLEMENTED, version=bodhi.js/providers/2.1.3)"
    }

Logs in the node, notice Execution Error(OutOfGas)?

mandala-node_1    | 2021-11-23 21:36:36.182 DEBUG ThreadId(59) evm: Execution logs []    
mandala-node_1    | 2021-11-23 21:36:36.182 DEBUG ThreadId(59) evm: handle_mirrored_token: address: 0x3d3593927228553b349767aba68d4fb1514678cb    
mandala-node_1    | 2021-11-23 21:36:36.182 DEBUG ThreadId(59) evm: handle_mirrored_token: address: 0x000000000000000000636f6e736f6c652e6c6f67    
mandala-node_1    | 2021-11-23 21:36:36.182 DEBUG ThreadId(59) evm: Call execution using address 0x0000…6f67: Succeed(Stopped)    
mandala-node_1    | 2021-11-23 21:36:36.182 DEBUG ThreadId(59) evm: Updating storage for 0x3d3593927228553b349767aba68d4fb1514678cb [index: 0x0000000000000000000000000000000000000000000000000000000000000000, value: 0x48656c6c6f2c204861726468617421000000000000000000000000000000001e]    
mandala-node_1    | 2021-11-23 21:36:36.182 DEBUG ThreadId(59) evm: Create execution using address 0x3d35…78cb: Succeed(Returned)    
mandala-node_1    | 2021-11-23 21:36:36.182 DEBUG ThreadId(59) evm: Inserting code (1851 bytes) at 0x3d3593927228553b349767aba68d4fb1514678cb    
mandala-node_1    | 2021-11-23 21:36:36.182 DEBUG ThreadId(59) evm: Execution Succeed(Returned) [source: 0x75e480db528101a381ce68544611c169ad7eb342, value: 0, gas_limit: 512520, actual_fee: 500239]    
mandala-node_1    | 2021-11-23 21:36:36.182 DEBUG ThreadId(59) evm: Execution logs []    
mandala-node_1    | 2021-11-23 21:36:36.182 DEBUG ThreadId(59) evm: handle_mirrored_token: address: 0x3d3593927228553b349767aba68d4fb1514678cb    
mandala-node_1    | 2021-11-23 21:36:36.182 DEBUG ThreadId(59) evm: handle_mirrored_token: address: 0x000000000000000000636f6e736f6c652e6c6f67    
mandala-node_1    | 2021-11-23 21:36:36.182 DEBUG ThreadId(59) evm: Call execution using address 0x0000…6f67: Succeed(Stopped)    
mandala-node_1    | 2021-11-23 21:36:36.182 DEBUG ThreadId(59) evm: Updating storage for 0x3d3593927228553b349767aba68d4fb1514678cb [index: 0x0000000000000000000000000000000000000000000000000000000000000000, value: 0x48656c6c6f2c204861726468617421000000000000000000000000000000001e]    
mandala-node_1    | 2021-11-23 21:36:36.182 DEBUG ThreadId(59) evm: Create execution using address 0x3d35…78cb: Succeed(Returned)    
mandala-node_1    | 2021-11-23 21:36:36.182 DEBUG ThreadId(59) evm: Execution Error(OutOfGas) [source: 0x75e480db528101a381ce68544611c169ad7eb342, value: 0, gas_limit: 463368, actual_fee: 463368]    
mandala-node_1    | 2021-11-23 21:36:36.182 DEBUG ThreadId(59) evm: Execution logs []    
mandala-node_1    | 2021-11-23 21:36:36.183 DEBUG ThreadId(59) evm: handle_mirrored_token: address: 0x3d3593927228553b349767aba68d4fb1514678cb    
mandala-node_1    | 2021-11-23 21:36:36.183 DEBUG ThreadId(59) evm: handle_mirrored_token: address: 0x000000000000000000636f6e736f6c652e6c6f67    
mandala-node_1    | 2021-11-23 21:36:36.183 DEBUG ThreadId(59) evm: Call execution using address 0x0000…6f67: Succeed(Stopped)    
mandala-node_1    | 2021-11-23 21:36:36.183 DEBUG ThreadId(59) evm: Updating storage for 0x3d3593927228553b349767aba68d4fb1514678cb [index: 0x0000000000000000000000000000000000000000000000000000000000000000, value: 0x48656c6c6f2c204861726468617421000000000000000000000000000000001e]    
mandala-node_1    | 2021-11-23 21:36:36.183 DEBUG ThreadId(59) evm: Create execution using address 0x3d35…78cb: Succeed(Returned)    
mandala-node_1    | 2021-11-23 21:36:36.183 DEBUG ThreadId(59) evm: Execution Error(OutOfGas) [source: 0x75e480db528101a381ce68544611c169ad7eb342, value: 0, gas_limit: 487944, actual_fee: 487944]    
mandala-node_1    | 2021-11-23 21:36:36.183 DEBUG ThreadId(59) evm: Execution logs []    
mandala-node_1    | 2021-11-23 21:36:36.183 DEBUG ThreadId(59) evm: handle_mirrored_token: address: 0x3d3593927228553b349767aba68d4fb1514678cb    
mandala-node_1    | 2021-11-23 21:36:36.183 DEBUG ThreadId(59) evm: handle_mirrored_token: address: 0x000000000000000000636f6e736f6c652e6c6f67    
mandala-node_1    | 2021-11-23 21:36:36.183 DEBUG ThreadId(59) evm: Call execution using address 0x0000…6f67: Succeed(Stopped)    
mandala-node_1    | 2021-11-23 21:36:36.183 DEBUG ThreadId(59) evm: Updating storage for 0x3d3593927228553b349767aba68d4fb1514678cb [index: 0x0000000000000000000000000000000000000000000000000000000000000000, value: 0x48656c6c6f2c204861726468617421000000000000000000000000000000001e]    
mandala-node_1    | 2021-11-23 21:36:36.183 DEBUG ThreadId(59) evm: Create execution using address 0x3d35…78cb: Succeed(Returned)    
mandala-node_1    | 2021-11-23 21:36:36.183 DEBUG ThreadId(59) evm: Inserting code (1851 bytes) at 0x3d3593927228553b349767aba68d4fb1514678cb    
mandala-node_1    | 2021-11-23 21:36:36.183 DEBUG ThreadId(59) evm: Execution Succeed(Returned) [source: 0x75e480db528101a381ce68544611c169ad7eb342, value: 0, gas_limit: 500232, actual_fee: 500047]    
mandala-node_1    | 2021-11-23 21:36:36.183 DEBUG ThreadId(59) evm: Execution logs [] 

implement `eth_feeHistory`

Seems to be required to use hardhat/ethers tooling.

[1636581798997] DEBUG (1522457 on XPS-15-7590): incoming request
    jsonrpc: "2.0"
    method: "eth_feeHistory"
    params: [
      "0x1",
      "latest",
      [
        50
      ]
    ]
    id: 9
[1636581798997] DEBUG (1522457 on XPS-15-7590): request completed
    id: 9
    jsonrpc: "2.0"
    error: {
      "code": -32601,
      "data": "The method eth_feeHistory does not exist / is not available.",
      "message": "Method not found"
    }

Fix deps warning

warning @acala-network/bodhi > @open-web3/dev-config > coveralls > [email protected]: request has been deprecated, see https://github.com/request/request/issues/3142
warning @acala-network/bodhi > @open-web3/dev-config > jest-config > jest-environment-jsdom > jsdom > [email protected]: request has been deprecated, see https://github.com/request/request/issues/3142
warning @acala-network/bodhi > @open-web3/dev-config > jest-config > jest-environment-jsdom > jsdom > [email protected]: request-promise-native has been deprecated because it extends the now deprecated request package, see https://github.com/request/request/issues/3142
[2/4] 🚚  Fetching packages...
[3/4] 🔗  Linking dependencies...
warning "@acala-network/bodhi > @open-web3/[email protected]" has unmet peer dependency "@polkadot/api@^3.6.4".
warning "@acala-network/bodhi > @open-web3/dev-config > [email protected]" has unmet peer dependency "styled-components@>= 2".
warning "@acala-network/bodhi > @open-web3/[email protected]" has unmet peer dependency "@polkadot/api@^3.6.4".
warning "@acala-network/bodhi > @open-web3/dev-config > [email protected]" has incorrect peer dependency "[email protected] || 4.0.x".
warning "@acala-network/bodhi > @open-web3/dev-config > [email protected]" has incorrect peer dependency "typedoc@>=0.20.0".

set up testing env

Currently it is hard to test, especially with CI. There are 3 ways to test:

  • run a local node, but this can't integrate with CI
  • build a test docker image, this will need some time
  • wait for a working public testnet

`eth_getTransactionByHash` should return nonce as hex

Desired behavior: "nonce":"0x3", // 3

Current behavior:

[1637708448377] DEBUG (933387 on XPS-15-7590): incoming request
    id: 19
    jsonrpc: "2.0"
    params: [
      "0x69beb839f0f2204b1467d71e802ea8a0815c041f6bfacb1adf3f79f048f21402"
    ]
    method: "eth_getTransactionByHash"
[1637708448394] DEBUG (933387 on XPS-15-7590): request completed
    id: 19
    jsonrpc: "2.0"
    result: {
      "from": "0x75e480db528101a381ce68544611c169ad7eb342",
      "to": null,
      "hash": "0x69beb839f0f2204b1467d71e802ea8a0815c041f6bfacb1adf3f79f048f21402",
      "blockHash": "0xaf255ecd69d77705702ddc189af6433b2ef38b6eafd00f05ad43ab075b584da6",
      "nonce": "3",
      "blockNumber": "0xa6",
      "transactionIndex": "0x2",
      "value": "0x0",
      "gasPrice": "0x1",
      "gas": "0x0",
      "input": "0x608060

https://eth.wiki/json-rpc/API#eth_gettransactionbyhash

TypeError: this.provider.getFeeData is not a function

When I use the jest framework to call the contract for asset approval, the following error is reported.
image
How can I solve it?

This is part of the configuration of package.json:
{
"resolutions": {
"@polkadot/api": "^4.14.1",
"@polkadot/types": "^4.14.1"
},
"dependencies": {
"@acala-network/api": "1.0.2-1",
"@acala-network/bodhi": "1.0.0",
"@acala-network/contracts": "^1.0.22"
},
"devDependencies": {
"@types/jest": "^26.0.24",
"jest": "^26.6.3",
"ts-jest": "^26.5.3",
"typescript": "^4.2.3",
"jest-html-reporters": "^2.1.6"
},
"scripts": {
"test": "jest"
}
}

jest.config.js
module.exports = {
transform: {
'^.+\.(t|j)sx?$': 'ts-jest'
},
transformIgnorePatterns: ['/node_modules/(?!(@PolkaDot|@babel/runtime/helpers/esm/))'],
reporters: [
"default",
["jest-html-reporters", {
"publicPath": "./html-report",
"filename": "report.html",
"expand": true
}]
]
};

no return value for `eth_call`

From the command line:

➜  hardhat npx hardhat console --network development
Welcome to Node.js v14.18.1.
Type ".help" for more information.
> const Greeter = await ethers.getContractFactory("Greeter");
undefined
> const greeter = await Greeter.attach('0x851def71f0e6a903375c1e536bd9ff1684bad802')
undefined
> await greeter.greet()
Uncaught:
Error: call revert exception (method="greet()", errorArgs=null, errorName=null, errorSignature=null, reason=null, code=CALL_EXCEPTION, version=abi/5.5.0)
    at step (/home/acala/hardhat/node_modules/@ethersproject/contracts/lib/index.js:48:23)
    at Contract.<anonymous> (/home/acala/hardhat/node_modules/@ethersproject/contracts/src.ts/index.ts:392:44)
    at Interface.decodeFunctionResult (/home/acala/hardhat/node_modules/@ethersproject/abi/src.ts/interface.ts:425:23)
    at Logger.throwError (/home/acala/hardhat/node_modules/@ethersproject/logger/src.ts/index.ts:237:20)
    at Logger.makeError (/home/acala/hardhat/node_modules/@ethersproject/logger/src.ts/index.ts:225:28) {
  reason: null,
  code: 'CALL_EXCEPTION',
  method: 'greet()',
  errorArgs: null,
  errorName: null,
  errorSignature: null,
  address: '0x851def71f0e6a903375c1e536bd9ff1684bad802',
  args: [],
  transaction: {
    data: '0xcfae3217',
    to: '0x851dEf71f0e6A903375C1e536Bd9ff1684BAD802',
    from: '0x75E480dB528101a381Ce68544611C169Ad7EB342'
  }
}

Results from RPC:

[1637274024790] DEBUG (2628826 on XPS-15-7590): incoming request
    jsonrpc: "2.0"
    method: "eth_call"
    params: [
      {
        "from": "0x75e480db528101a381ce68544611c169ad7eb342",
        "to": "0x851def71f0e6a903375c1e536bd9ff1684bad802",
        "data": "0xcfae3217"
      },
      "latest"
    ]
    id: 5
[1637274024796] DEBUG (2628826 on XPS-15-7590): request completed
    id: 5
    jsonrpc: "2.0"
    result: "0x"

`npm i @acala-network/bodhi` fails with `enoent ENOENT: no such file or directory`

Installing bodhi.js with npm:

npm i @acala-network/bodhi

results into:

47637 verbose stack Error: ENOENT: no such file or directory, chmod '/home/jure/workspace/tmp/node_modules/@open-web3/dev-config/scripts/polkadot-exec-lerna.cjs'
47638 verbose cwd /home/jure/workspace/tmp
47639 verbose Linux 4.15.0-136-generic
47640 verbose argv "/usr/local/bin/node" "/usr/local/bin/npm" "i" "@acala-network/bodhi"
47641 verbose node v14.15.4
47642 verbose npm  v6.14.10
47643 error code ENOENT
47644 error syscall chmod
47645 error path /home/jure/workspace/tmp/node_modules/@open-web3/dev-config/scripts/polkadot-exec-lerna.cjs
47646 error errno -2
47647 error enoent ENOENT: no such file or directory, chmod '/home/jure/workspace/tmp/node_modules/@open-web3/dev-config/scripts/polkadot-exec-lerna.cjs'
47648 error enoent This is related to npm not being able to find a file.
47649 verbose exit [ -2, true ]

How can I make it work?

docker mandala node outdated

Currently due to outdated docker mandala image, many of the test cases doesn't work anymore with docker.

In order for docker to have consistent behavior with running each service separately, we need to update docker image (maybe wait til the public testnet version?)

Upgrade ethers to v5.4.x

I would like to use bodhi.js together with typechain. There're some conflicts with latest typechain and @typechain/ethers-v5, which I think can be solved by upgrading @typechain/ethers-v5

Metamask send token failure

when using the test account from here with metamask, https://github.com/AcalaNetwork/Acala/blob/66b83277f203b1515fac7cdfa2db4da8d8cfb6e0/node/service/src/chain_spec/mandala.rs#L77-L80, sending token will fail due with this error:

request error
    methodName: "eth_sendRawTransaction"
    params: [
      "0x02f87482053980843b9aca008477359400825728940085560b24769dac4ed057f1b2ae40746aa9aab6888ac7230489e8000080c080a0158ba84828b01dfaf67b5a2e17360346316ccb12f4fcebfa459178ce4be41915a05a63dae5dfc9e32618405fd7ef60a2d11e19251e641cfcd517aca14473c09f4d"
    ]
    err: {
      "type": "Error",
      "message": "1010: Invalid Transaction: Transaction is outdated",
      ...
    }

Deal with storage usage in estimate gas

Depends on AcalaNetwork/Acala#804

Eth API only deal we gas limit but we have gas limit + storage limit.
We we need to make the eth gas limit to be both gas limit + storage limit.

For estimate gas / convert gas limit + storage limit to eth gas limit:

  • use the estimate resources API to get gas limit & storage limit & weight fee
  • gas_fee = weight_fee / gas_limit
  • storage_fee = storage_limit * StorageDepositPerByte
  • storage_gas_limit = storage_fee / gas_fee
  • total_gas_limit = gas_limit + storage_gas_limit

For submit transaction / convert eth gas limit to gas limit + storage limit:

  • use the estimate gas code to calculate storage_gas_limit
  • calculate the ratio between gas_limit and stroage_gas_limit
  • divide the eth gas limit to gas_limit and storage_gas_limit with the above ratio
  • maybe +1 to both to avoid rounding issue?

example not work

The project 'evm-waffle-example-hello-world' does not exist in rush.json.

`eth_sendRawTransaction` seems to not return the right contract address

Behavior on ganache: Match!
image

Behavior on bodhi: No Match!
image

Ganache:

➜  hardhat npx hardhat run scripts/sample-script.js --network development
Greeter deployed to: 0x3d3593927228553b349767ABa68d4fb1514678CB
➜  hardhat 
➜  hardhat npx hardhat console --network development
Welcome to Node.js v14.18.1.
Type ".help" for more information.
> const Greeter = await ethers.getContractFactory("Greeter");
undefined
> const greeter = await Greeter.attach('0x3d3593927228553b349767ABa68d4fb1514678CB');
undefined
> await greeter.greet()
'Hello, Hardhat!'
> 
(To exit, press Ctrl+C again or Ctrl+D or type .exit)
> 
Listening on 127.0.0.1:8545
web3_clientVersion
eth_chainId
eth_blockNumber
eth_chainId
eth_chainId
eth_estimateGas
eth_getBlockByNumber
eth_getBlockByNumber
eth_gasPrice
eth_getTransactionCount
eth_chainId
eth_sendRawTransaction

  Transaction: 0xc9c911bfb1b4c9a6ff439a4c012d279dc696fa4120644056a968f8ee91b8a974
  Contract created: 0x3d3593927228553b349767aba68d4fb1514678cb
  Gas usage: 493826
  Block Number: 1
  Block Time: Mon Nov 22 2021 14:42:46 GMT-0500 (GMT-05:00)

eth_chainId
eth_getTransactionByHash
eth_chainId
eth_getTransactionReceipt
web3_clientVersion
eth_chainId
eth_chainId
eth_call

Bodhi:

➜  hardhat npx hardhat run scripts/sample-script.js --network development
Greeter deployed to: 0xD26e19913ca16B5B59aF7f07472f97cC9eA3f12B
➜  hardhat npx hardhat console --network development                     
Welcome to Node.js v14.18.1.
Type ".help" for more information.
> const Greeter = await ethers.getContractFactory("Greeter");
undefined
> const greeter = await Greeter.attach('0x3d3593927228553b349767aba68d4fb1514678cb');
undefined
> await greeter.greet()
'Hello, Hardhat!'
> 
[1637610589548] DEBUG (393790 on XPS-15-7590): incoming request
    jsonrpc: "2.0"
    method: "eth_getTransactionReceipt"
    params: [
      "0xfc78254710528e5512b56cb65fd82b20e07096c8613c1818f83b756c555658da"
    ]
    id: 24
[1637610589559] DEBUG (393790 on XPS-15-7590): request completed
    id: 24
    jsonrpc: "2.0"
    result: {
      "to": null,
      "from": "0x75e480db528101a381ce68544611c169ad7eb342",
      "contractAddress": "0x3d3593927228553b349767aba68d4fb1514678cb",
      "transactionIndex": "2",
      "gasUsed": "0",
      "logsBloom": "0x",
      "blockHash": "0x933f845f22fda331412c2d0447e0b5650a9c2bacfbf8f342b23fb78ffd36811e",
      "transactionHash": "0xfc78254710528e5512b56cb65fd82b20e07096c8613c1818f83b756c555658da",
      "logs": [],
      "blockNumber": "37",
      "cumulativeGasUsed": "0",
      "type": "0",
      "status": "1",
      "effectiveGasPrice": "0x1",
      "confirmations": "0x1"
    }

erc20 example test failure

 15 passing (46s)
  2 failing

  1) ACAToken
       Transfer adds amount to destination account:
     AssertionError: Expected "751907535" to be equal 7
      at Context.<anonymous> (test/ACAToken.test.ts:50:82)
      at processTicksAndRejections (internal/process/task_queues.js:93:5)

  2) BasicToken
       Can not transfer from empty account:
     AssertionError: Expected transaction to be reverted, but other exception was thrown: Error: -32603: execution fatal: Module { index: 180, error: 2, message: Some("NoPermission") }

scheduler example failure

3 passing (2m)
  2 failing

  1) Schedule
       works with RecurringPayment:
     Error: Timeout of 50000ms exceeded. For async tests and hooks, ensure "done()" is called; if returning a Promise, ensure it resolves. (/Users/shunjizhan/Acala/bodhi.js/examples/scheduler/test/Scheduler.test.ts)
      at listOnTimeout (internal/timers.js:554:17)
      at processTimers (internal/timers.js:497:7)

  2) Schedule
       works with Subscription:
     Error: 1014: Priority is too low: (399627509098620 vs 366996901750516): The transaction has too low priority to replace another transaction already in the pool.
      at RpcCoder._checkError (/Users/shunjizhan/Acala/bodhi.js/common/temp/node_modules/.pnpm/@[email protected]/node_modules/@polkadot/rpc-provider/coder/index.cjs:84:13)
      at RpcCoder.decodeResponse (/Users/shunjizhan/Acala/bodhi.js/common/temp/node_modules/.pnpm/@[email protected]/node_modules/@polkadot/rpc-provider/coder/index.cjs:47:10)
      at WsProvider.value (/Users/shunjizhan/Acala/bodhi.js/common/temp/node_modules/.pnpm/@[email protected]/node_modules/@polkadot/rpc-provider/ws/index.cjs:260:90)
      at W3CWebSocket.value [as onmessage] (/Users/shunjizhan/Acala/bodhi.js/common/temp/node_modules/.pnpm/@[email protected]/node_modules/@polkadot/rpc-provider/ws/index.cjs:240:153)
      at W3CWebSocket._dispatchEvent [as dispatchEvent] (/Users/shunjizhan/Acala/bodhi.js/common/temp/node_modules/.pnpm/[email protected]/node_modules/yaeti/lib/EventTarget.js:107:17)
      at W3CWebSocket.onMessage (/Users/shunjizhan/Acala/bodhi.js/common/temp/node_modules/.pnpm/[email protected]/node_modules/websocket/lib/W3CWebSocket.js:234:14)
      at WebSocketConnection.<anonymous> (/Users/shunjizhan/Acala/bodhi.js/common/temp/node_modules/.pnpm/[email protected]/node_modules/websocket/lib/W3CWebSocket.js:205:19)
      at WebSocketConnection.EventEmitter.emit (domain.js:467:12)
      at WebSocketConnection.processFrame (/Users/shunjizhan/Acala/bodhi.js/common/temp/node_modules/.pnpm/[email protected]/node_modules/websocket/lib/WebSocketConnection.js:554:26)
      at /Users/shunjizhan/Acala/bodhi.js/common/temp/node_modules/.pnpm/[email protected]/node_modules/websocket/lib/WebSocketConnection.js:323:40
      at processTicksAndRejections (internal/process/task_queues.js:75:11)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.