Derek Pierre
ee26e9ecad
Merge pull request #3571 from derekpierre/non-evm-rpc
...
JsonRpcCondition (JSON RPC 2.0 specification)
2025-01-06 08:41:19 -05:00
derekpierre
74df16e015
Apply AI RFCs from #3571 .
...
- Use random uuid4 as id for request
- Improve error handling in case code/message isn't available.
- Add to headers dictionary instead of recreating
- offchain -> off-chain
2025-01-02 10:04:15 -05:00
derekpierre
f718a00ba1
Add common base condition class for JSON Api and Rpc for common verify method.
2024-12-29 20:58:58 -05:00
derekpierre
6553f6bd77
Ensure that result field is present in JSON RPC response before processing.
2024-12-29 20:42:41 -05:00
derekpierre
cc1954cf04
Add acceptance test that showcases possible prototyping strategy for making RPC calls on non-evm blockchains.
2024-12-20 09:35:50 -05:00
derekpierre
b7cb9375a7
Improve test coverage.
...
Minor code clean up.
2024-12-19 10:33:02 -05:00
derekpierre
cd7a0de529
Add newsfragment for #3571 .
2024-12-19 10:33:01 -05:00
derekpierre
bc8ff993c8
Fix processing logic of json path query; proper exceptions are handled and raised.
2024-12-19 10:33:00 -05:00
derekpierre
834cd7dd69
Clean up repeated member variable from JsonRpcCondition.
2024-12-19 10:33:00 -05:00
derekpierre
258f5cd3ae
Use json parameter instead of data when using requests.post; also simplifies testing.
2024-12-19 10:32:59 -05:00
derekpierre
91779df1fb
Add unit tests for JsonRpcCondition.
2024-12-19 10:32:58 -05:00
derekpierre
e51a02c26a
Split out JsonPathField tests into its own test module.
2024-12-19 10:32:57 -05:00
derekpierre
9440dd1820
Update exception error message for failed JSON rpc call.
2024-12-19 10:32:56 -05:00
derekpierre
3cade99a43
Fix incorrect naming.
2024-12-19 10:32:55 -05:00
derekpierre
504c2d0498
Update code based on limitations of python 3.9. `http.HTTPMethod` and `typing.override` are not available.
2024-12-19 10:32:54 -05:00
derekpierre
a629f9b9a1
Allow authorization_token to be passed along.
...
Some code clean up.
2024-12-19 10:32:53 -05:00
derekpierre
4655d667e4
Initial functionality for JSON RPC conditions. These are split into two types: JsonRpcCondition (any json endpoint, where the endpoint is specified), NonEvmJsonRpcCondition where default RPC endpoints based on blockchain name are utilized.
...
JsonRpcCondition could be used as is for GraphQL type functionality.
NonEvmRpcCondition is specific to non-evm blockchains - unsure which we will support at the moment; at least "solana" and "bitcoin"...what does this mean for `:userAddress`...?
2024-12-19 10:32:52 -05:00
derekpierre
2a112005ff
Refactor JSON functionality into its own package.
...
JsonRequestCall is the base abstract class for all HTTPS JSON-based requests.
JsonApiCall subclasses JSONRequestCall for use with the JsonApiCondition.
Update imports and references accordingly.
2024-12-19 10:32:51 -05:00
Derek Pierre
254b0c54fb
Merge pull request #3569 from derekpierre/any-rpc
...
EVM Condition on "Any" (Major) EVM Chain (only `lynx` for now)
2024-12-19 08:36:17 -05:00
derekpierre
779a4534f7
Apply RFCs for #3569 .
...
Co-authored-by: David Núñez <david@nucypher.com>
2024-12-18 10:27:45 -05:00
derekpierre
9494ede171
Apply RFCs - update variable name, and update associated log/exception messages.
2024-12-16 09:27:10 -05:00
derekpierre
dde6c06b58
Apply RFC - rename CHAINLIST_URL constant.
2024-12-16 09:17:48 -05:00
James Campbell
d1460a40ee
Remove commented line
2024-12-13 10:06:14 +01:00
derekpierre
acf59fdd9f
Remove commented out lines in tests concerning unsupported chain ids. Condition objects don't have any concept of TACo domains and therefore have no insight into which chains are supported. Now that `lynx` supports "any" EVM chain this has become more evident and those test cases are not longer valid.
2024-12-12 12:39:33 -05:00
derekpierre
8d1a68b7b6
Add feature newsfragment for #3569 .
2024-12-12 09:56:52 -05:00
derekpierre
d3af0637d0
Fix linting issue.
2024-12-12 09:42:14 -05:00
Derek Pierre
c1fa8502ae
Merge pull request #8 from theref/default-rpc
...
Use existing default rpc functionality
2024-12-12 09:13:21 -05:00
James Campbell
da23d687be
Add check for user supplied endpoints
2024-12-12 14:02:05 +01:00
James Campbell
8668583ba0
Use `functools.cache` instead of memoize and update tests accordingly
2024-12-12 13:58:40 +01:00
James Campbell
4f9d9fba22
Improve doc strings to match type hints
...
Co-authored-by: Derek Pierre <derek.pierre@gmail.com>
2024-12-12 13:52:53 +01:00
James Campbell
d3c7be4db7
Fix domain bug and move rpc endpoint shuffling
2024-12-12 13:51:06 +01:00
James Campbell
25eec7314c
Shuffle rpc endpoints
2024-12-11 16:37:42 +01:00
James Campbell
456195a8c6
Improve commenting
...
Co-authored-by: Derek Pierre <derek.pierre@gmail.com>
2024-12-11 15:08:17 +01:00
James Campbell
d06d2880a3
Use TACoDomain object when fetching rpc
2024-12-11 13:13:25 +01:00
James Campbell
08359f4812
Improve handling of chainlist url string
...
Co-authored-by: Derek Pierre <derek.pierre@gmail.com>
2024-12-11 13:01:49 +01:00
James Campbell
d2a4536612
Remove condition chain validation from Operator and update test infrastructure
2024-12-10 11:47:58 +01:00
James Campbell
681ae66bf5
Refactor RPC endpoint management to use domain-specific endpoints
2024-12-10 11:47:36 +01:00
James Campbell
c8d5227d28
Remove condition chains concept from domains and related tests
2024-12-10 11:47:32 +01:00
derekpierre
007fdeb9fc
Stop using deprecated datetime methods.
2024-12-06 14:11:40 -05:00
derekpierre
cfef6c1a8f
Add randomness to returned list so that the same endpoints are not used every time and by every node.
2024-12-06 12:37:14 -05:00
derekpierre
f323bf212b
Comment out chain id validation for now, since it is possible to use other chains. We probably want to still do validation on mainnet, but not on lynx - let's deal with that in a later commit.
...
Comment out tests on validity of chain id provided to EVM conditions.
2024-12-06 12:13:23 -05:00
derekpierre
b4a6e24d58
Fix faulty condition tests - each needed a new copy of the condition dict.
2024-12-06 12:13:21 -05:00
derekpierre
d414553e53
Use utility to fetch public rpc endpoints when there are no providers for chain configured.
2024-12-06 12:13:17 -05:00
derekpierre
8cbc0f12d3
Add utility function of obtain public rpc urls from chainid.network based on chain id.
2024-12-06 11:45:36 -05:00
Derek Pierre
0839427718
Merge pull request #3564 from theref/json
...
Json Condition :userAddress context variable
2024-12-04 09:33:44 -05:00
James Campbell
11499a3462
Update test from EIP712 to EIP4361
2024-11-29 17:39:40 +01:00
James Campbell
40339d4f5e
Fix json api test
2024-11-29 17:39:40 +01:00
James Campbell
7710d5a2e4
Add failing test for :userAddress in json api condition url
2024-11-29 17:39:40 +01:00
derekpierre
fb86b9ed37
Update dependencies to latest versions.
2024-11-06 13:15:31 -05:00
Derek Pierre
a365fa8a45
Merge pull request #3563 from derekpierre/dep-update
...
Relock dependencies
2024-11-06 11:35:50 -05:00