Commit Graph

50 Commits

Author SHA1 Message Date
Will 85b3567d94
Feature/execution api spec (#69)
* Fix problem with contract out of assets

* Add nully value json test

* Fix bug with passing null to a few functions

* Typesafe U256 parsing

* Update readme for the web3 to include runner info

* Cleanup commits

Strip out unused JSON

Update comment

Remove echo

Added DynamicBytes test

More correct naming

Remove one extra double check

* Add specific object tests

* Ensure we cover different status types

* Add header comments

* Cleanup

* Add more tests

* Cleanup

* Revert docs

* Nimpretty file

* Fix issue in base stew

* Add tests

* Sorting

* Work on tests

* Move items to the correct location

* Add TODO

* Add all test executables

* Work on generating tests

* Push latest execution API changes

* Work on eth_call test

* Fix source type

* Latest

* Add many more tests

* Add more tests

* Revert "from" to "source"

* Try fix types

* Split to types which fail and those which dont

* Cleanup

* Remove whispher types again

* re-remove whisper

* Add more eth_api signature

* Readding executions-apis submodule

* Disable test_execution_api

* Nitpick

* add handlers

* Add last line to handler

* Some handler pass

* Finally all tests pass

* Add the test to all_tests

* Consisten style

* Turn on submodule downloading in CI

* Temporary workaround of get eth_getBlockReceipts for nim 2.0

---------

Co-authored-by: jangko <jangko128@gmail.com>
2024-01-11 21:02:42 +07:00
Yuriy Glukhov eea0344679 More flexibility to contract DSL, Async contract caller 2024-01-09 14:57:29 +01:00
Yuriy Glukhov edf785d424 Added string encoding 2024-01-08 14:58:29 +01:00
Yuriy Glukhov 09ce974cab Contract constructor support 2024-01-08 14:57:09 +01:00
jangko 23b333eb51
Add tests of json rpc marshalled types 2024-01-07 22:02:45 +07:00
jangko ef317bc846
Migrate to json-serialization 2024-01-07 17:23:00 +07:00
jangko be1bb307dc
Reduce compiler warnings when using Nim v2 2024-01-02 09:33:15 +07:00
Will 23c06ca6d2
Bugfix/nully values (#61)
* Fix problem with contract out of assets

* Add nully value json test

* Fix bug with passing null to a few functions

* Typesafe U256 parsing

* Update readme for the web3 to include runner info

* Cleanup commits

Strip out unused JSON

Update comment

Remove echo

Added DynamicBytes test

More correct naming

Remove one extra double check

* Add specific object tests

* Ensure we cover different status types

* Add header comments

* Cleanup

* Add more tests

* Cleanup

* Revert docs

* Nimpretty file

* Fix issue in base stew

* v0.2.4

* Fix test

---------

Co-authored-by: jangko <jangko128@gmail.com>
2023-12-14 06:56:54 +07:00
Eugene Kabanov 195c8c60b4
Fix send() transaction to be working again with EIP-155. (#105)
* Fix send() transaction to be working again with EIP-155.
Add tests.
---------

Co-authored-by: jangko <jangko128@gmail.com>
2023-12-13 13:23:31 +07:00
Yuriy Glukhov 45d09b29d2
Refactoring, contract dsl wasm compatibility, encode/decode fixes. (#108)
* Refactoring, contract dsl wasm compatibility, fixes in encoding/decoding.

* Tests

* Fixed Nim 1.* compatibility

* Some backward compatibility

* Minor tweaks, and a safety check

* Update web3/encoding.nim

Co-authored-by: Jacek Sieka <arnetheduck@gmail.com>

* Update web3.nim

Co-authored-by: Jacek Sieka <arnetheduck@gmail.com>

* Use stew.assign instead of reinventing the wheel

* Fixed string decoder. Removed extra allocations.

* Added test for string decoder

* v0.2.2

---------

Co-authored-by: Jacek Sieka <arnetheduck@gmail.com>
Co-authored-by: jangko <jangko128@gmail.com>
2023-12-13 12:26:04 +07:00
jangko dcabb8f29e
v0.2.0: Revamp data types 2023-12-12 12:15:34 +07:00
Etan Kissling 6212e659e5
replace `{.raises: [Defect].}` with `{.raises: [].}` (Nim 1.6) (#104)
With Nim 1.6, `Defect` does not need to be specified anymore inside
`{.raises.}` and triggers redundant `XCannotRaiseY` hints. Remove.
2023-10-05 12:37:04 +02:00
Etan Kissling 91113bef0a
update `ReceiptObject` and `LogObject` (#101)
Extend `ReceiptObject` and `LogObject` according to documentation at:

- https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_gettransactionreceipt
- https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getfilterchanges

Also fix the `LogObject` types from `string` to `Quantity`.
2023-08-25 23:20:04 +02:00
Zahary Karadjov bf6c24dba5
Fix a deposit syncing regression in nimbus-eth2 2023-03-07 03:30:14 +02:00
Zahary Karadjov 4df2822521
Add json serialization for the Quantity type 2023-02-27 16:40:25 +02:00
Tanguy 1e2e2e6d16
Fiw newRng usage (#72) 2022-11-24 15:11:41 +01:00
KonradStaniec 16a9211686
Handle empty data hex string (#71) 2022-11-18 14:29:40 +01:00
Jacek Sieka 5e20893ef9
tighten nimcrypto imports (#58) 2022-09-05 19:29:33 +02:00
KonradStaniec 06ef3497d4
Add client for eth_getProof (#56) 2022-08-31 22:57:20 +02:00
Miran d4f98950fd
move `-d:nimRawSetjmp` to config.nims (#51)
* move `-d:nimRawSetjmp` to config.nims

Refs https://github.com/status-im/nimbus-build-system/issues/44

* use .cfg not .nims
2022-07-12 21:04:31 +03:00
tersec 731bdfe907
don't enforce no-leading-zeros (#55) 2022-07-12 12:31:53 +03:00
tersec ae12813602
enforce JSON-RPC Quantity spec syntax rules (#53)
* enforce JSON-RPC Quantity spec syntax rules

* threadsafe test setup
2022-07-07 12:26:13 +03:00
Jacek Sieka d260915a0c
enable `styleCheck:usages` (#49) 2022-04-07 15:52:36 +02:00
Mark Spanbroek 74d8345a3e Use correct types for deposit contract 2021-12-14 08:21:39 +01:00
Mark Spanbroek 2c02c3d770 Use correct gasprice for deposit contract test 2021-12-14 08:21:39 +01:00
Mark Spanbroek cfb02e19d3 Use actual Eth2 deposit contract for test 2021-12-14 08:21:39 +01:00
Mark Spanbroek 964002bc28 Fix signed transaction tests
Provide sufficiently high gas price to avoid
errors due to invalid gas price.
2021-12-14 08:21:39 +01:00
Mark Spanbroek 0dfaaffc3c Wrap tests in suites
To ensure that tests keep running when one of
them fails, and to have an indication of where
things go wrong.
2021-12-14 08:21:39 +01:00
Eric Mastro d62f8105a1
fix: allow Bool input/output types for contracts (#39)
* fix: allow Bool input/output types for contracts

Contracts created with the `contract` macro and having a method with a `Bool` input/output type were failing to compile. Example:
```
contract(MyContract):
  proc enableTransfers(
    transfersEnabled: Bool
  )
```
Failed with:
```
Error: type mismatch: got <type Bool>
but expected one of:
proc unknownType()
  first type mismatch at position: 1
  extra argument given

expression: unknownType(Bool)
```
This fix enables translating `Bool` type signatures to solidity’s `bool` type.

* add Bool encoding/decoding test
2021-09-21 12:02:06 +02:00
jangko 8337eb8b8b
fixes failing test cases
for unknown reason using "ws://localhost:8545/" is rejected.
but "ws://127.0.0.1:8545/" is ok.
2021-05-19 11:19:51 +07:00
Zahary Karadjov 0361338cea
Correct nonce values when sending multiple transactions 2020-08-01 19:41:39 +03:00
jangko 4097cfaf95
fix tests 2020-07-15 15:41:22 +07:00
jangko b29311a9d0
silence spurious warnings 2020-07-15 10:14:28 +07:00
jangko fd8b5de13c
fix test_signed_tx 2020-07-15 10:06:11 +07:00
Zahary Karadjov 71524f0f59
Fix nimble test 2020-06-30 15:59:21 +03:00
Jacek Sieka 73896c2226
fix 2020-06-22 17:09:35 +02:00
Viktor Kirilov f1d3e94dda event handlers should't be permitted to raise anything other than a Defect 2020-05-08 17:20:59 +03:00
Zahary Karadjov 270fd64620
Add convenience API for obtaining logs from a smart contract event 2020-04-18 17:24:59 +03:00
Zahary Karadjov 6927cd08a2
Allow specifying a block number when making smart contract calls
Other changes:

* More accurate RPC signatures
* Handle empty responses from the Web3 provider in `eth_call`
2020-04-18 17:24:59 +03:00
Jacek Sieka 969adf2f1e
keys: fix deprecations 2020-04-04 18:51:27 +02:00
Yuriy Glukhov 37fc461114
Fixed serialization compatibility with geth. Added getMinedTransactionReceipt 2019-10-30 15:05:44 +02:00
Yuriy Glukhov ecd2fb45a6 Added close function 2019-10-23 09:35:54 +09:00
Yuriy Glukhov 817c819847 Fixed fixed encoding, inputs/outputs parsing 2019-09-06 09:24:37 -04:00
Yuriy Glukhov 6ca87380a6 Fixes #5, implemented tx signing 2019-08-06 11:02:38 +03:00
Yuriy Glukhov cd0e216aaf Ergonomics changes 2019-07-31 13:13:26 +03:00
Yuriy Glukhov cf6dc7699f More fixes, fetch historical logs on subsciption, more tests 2019-07-22 12:09:09 +03:00
Yuriy Glukhov 1d6d413318 Fixed dynamic encoding, added deposit contract test 2019-07-22 12:09:09 +03:00
Yuriy Glukhov 1d58c88989 Event subscriptions 2019-07-22 12:09:09 +03:00
Yuriy Glukhov 4363d66838 Some fixes. Package structure updated. 2019-06-10 15:02:43 +03:00
PMunch eb14b4b706 Initial commit 2018-12-21 18:27:09 +01:00