Commit Graph

10181 Commits (dc488624e8b24fb93b26a1bc5fd52e34785c4c2f)

Author SHA1 Message Date
derekpierre dc488624e8 Improve testing for ConditionLingo, utils. Remove unceessary check for function_abi. 2022-11-16 12:28:15 -05:00
derekpierre ceee8bd2e9 Add tests for evaluate_condition() utils method. Fix incorrect type in method. 2022-11-16 12:27:12 -05:00
KPrasch 61e11032cd
Merge pull request #3017 from KPrasch/remove-header
Remove license header from modules
2022-11-16 17:20:55 +00:00
KPrasch e6fc9d83c6
Merge pull request #3018 from derekpierre/code-cov-refine
Code coverage refinement
2022-11-16 17:11:50 +00:00
Kieran Prasch c11731a9b0 remove license additions from pre-commit hooks 2022-11-16 16:56:28 +00:00
derekpierre 69bca85d2a Run coverage directly and not through pytest-cov - there are discrepancy in reports.
Only upload coverage reports after all tests have passed.
Premature optimization for only running code coverage for specific python matrix value, and run pytest directly otherwise.
2022-11-16 11:14:32 -05:00
Kieran Prasch 6ca73c2849 remove lisence header from tests 2022-11-16 13:27:47 +00:00
Kieran Prasch 1f1226c531 remove lisence header from nucypher modules 2022-11-16 13:23:16 +00:00
Derek Pierre 94227dc069
Merge pull request #3015 from KPrasch/middleware
response.json -> response.content
2022-11-15 11:30:28 -05:00
KPrasch 0f27f974b3
Merge pull request #3014 from theref/functionAbi
Resolve `function_abi` AFTER condition is initialized
2022-11-15 16:29:53 +00:00
Kieran Prasch 527ac143bc response.json -> response.content 2022-11-15 16:28:22 +00:00
Derek Pierre 57d4fa5d36
Update codecov to track development branch, where active development occurs. 2022-11-15 11:27:36 -05:00
James Campbell c432ecd8e4
Merge pull request #3010 from derekpierre/code-cov
Code Coverage
2022-11-15 15:25:11 +00:00
James Campbell bdaaafd9c3 Fix newsfragment and ensure conditions test has a valid method 2022-11-15 14:58:56 +00:00
James Campbell 4c5dadbad4 Resolve `function_abi` AFTER condition is initialized
Fixes #3012

Problem
-------
- when specifying a `standard_contract_type`, the `function_abi` is resolved
  immediately
- when this condition is serialized, it contains both `standard_contract_type`
  and `function_abi`, which we are trying to prevent

Solution
--------
- call `_resolve_abi` after the condition is initialized
2022-11-15 14:47:11 +00:00
derekpierre 1b37fbb319 Fail CI if coverage report cannot be uploaded. 2022-11-15 09:28:11 -05:00
derekpierre 3337b165b6 Add code coverage badge to README. 2022-11-14 18:09:01 -05:00
derekpierre 69bca8aace Only run tests for python 3.7 and 3.10. 2022-11-14 18:09:01 -05:00
derekpierre 47a8105509 Update coverage configuration to allow for better categorization of coverage reporting.
Fix coverage upload methodology.
Temporarily reduce python matrix until testing is completed.
2022-11-14 18:07:53 -05:00
derekpierre b45c93e025 Add code coverage. 2022-11-14 18:07:52 -05:00
KPrasch 131a7d4ced
Merge pull request #3002 from theref/key-value
Add custom abi conditions and key/value return values
2022-11-14 22:11:52 +00:00
derekpierre 853fa5406c Fixed bug regarding replacement of context variable when value is 0.
Added tests for return value test key as it pertains to tuples.
2022-11-14 15:50:18 -05:00
James Campbell 6567d4d30e Raise error when key and value are incompatible types 2022-11-14 18:34:46 +00:00
James Campbell 656ff8071c Improve error types raised by Return Values 2022-11-14 18:27:48 +00:00
KPrasch f68f0b092f
Merge pull request #3011 from KPrasch/server-update
Fixes missing call to response.json on HTTP 400.
2022-11-14 17:22:08 +00:00
Kieran Prasch 6d7e44de70 Fixes missing call to response.json on HTTP 400. 2022-11-14 15:27:14 +00:00
James Campbell 0e185438aa Add new error for issues when evaluating Return value 2022-11-14 14:45:32 +00:00
James Campbell 2f1a12a2e0 Improve error message for unprocessed context variables
Co-authored-by: Derek Pierre <derek.pierre@gmail.com>
2022-11-14 14:32:29 +00:00
James Campbell b700c0e287 Combine checks of key and value being context variables 2022-11-14 14:32:29 +00:00
James Campbell 9078ffacde Add docstring to `_process_data()` 2022-11-14 14:32:29 +00:00
James Campbell 775d890d3b Allow returnValueTest key to be None in serialization 2022-11-14 14:32:29 +00:00
Kieran Prasch 2c5db8e1f8 snake case t staking data fixture. 2022-11-14 14:32:29 +00:00
Kieran Prasch 38283661b1 Strict typing for _resolve_abi; Simplifies enforcement of single-function ABI for condition definition. 2022-11-14 14:32:27 +00:00
James Campbell 48cc132580 Use web3 to find functions from contract abi in return value test 2022-11-14 14:32:13 +00:00
James Campbell 52038237ad Add test to ensure eval can't run on context variable in return key 2022-11-14 14:32:13 +00:00
James Campbell da9f172598 Refactor processing of Return Value data 2022-11-14 14:32:13 +00:00
James Campbell e36b958912 Allow return value to be tuple and use modern `isinstance` over `type` 2022-11-14 14:32:13 +00:00
James Campbell 417c8b0fd4 Fix mocking of tester chain 2022-11-14 14:32:13 +00:00
James Campbell beec9958d1 Add test for method not in standard contract abi 2022-11-14 14:32:13 +00:00
James Campbell 6b2b072e12 Include tests for handling list index in ReturnValue 2022-11-14 14:32:13 +00:00
James Campbell b6f422ff4e Add basic tests for Return Value key 2022-11-14 14:32:10 +00:00
James Campbell 01d414b79a Fix parsing of function abi from standard contracts 2022-11-14 14:31:54 +00:00
James Campbell 65fede079c Ensure tests use valid condition chain id 2022-11-14 14:31:54 +00:00
James Campbell 8333e2cb16 Add newsfragment to the PR 3002 2022-11-14 14:31:54 +00:00
James Campbell 3bbbc7b262 Fix function abi schema to be a dict 2022-11-14 14:31:54 +00:00
James Campbell 53f6c9c08c Allow ReturnValue key to be int or str 2022-11-14 14:31:54 +00:00
James Campbell 4ce6f72695 Add basic test for custom abi condition 2022-11-14 14:31:54 +00:00
James Campbell 49a3ec2bf9 Allow key to be used in ReturnValueTest 2022-11-14 14:31:54 +00:00
KPrasch d96f052642
Merge pull request #3007 from derekpierre/server-update
Ursula server update - fix abstraction leaks
2022-11-11 18:32:24 +00:00
Kieran Prasch 961faf04f7 Regression test for unintentional reencryption upon falsy conditions. 2022-11-11 17:39:58 +00:00