derekpierre
b7f1a1085a
Apply RFCs from #2980 .
2022-10-18 20:09:26 +02:00
derekpierre
15819cde61
Time condition in test should use integers instead of strings.
2022-10-18 20:09:25 +02:00
derekpierre
27d6112de1
Exception occuring during RPC call is propagated back to the caller as error message.
...
Better exception handling by condition objects either at creation or verification - including some refactoring of RPCCondition/ContractCondition.
Added/updated unit tests.
2022-10-18 20:09:25 +02:00
derekpierre
e3446303b7
Remove support for None in ReturnValueTest - solidity has no concept of None/null so not needed. We can revisit later.
...
Updated condition tests to use 'is True' or 'is False'
Added SubscriptionManager test to show condition test whose contract call returns a struct and that the struct can be tested for equality/inequality.
2022-10-18 20:09:25 +02:00
derekpierre
d0d71944b9
Remove __eq__ from ReturnValueTest obj - only needed for tests.
2022-10-18 20:09:25 +02:00
derekpierre
658a4470a2
Apply RFCs from #2974 .
...
Co-authored-by: KPrasch <kieran@nucypher.com>
2022-10-18 20:09:25 +02:00
derekpierre
96c829d5a6
ReturnValueTest can now take any valid value type (including None) for comparison - this provides flexibility based on the result of a contract call.
...
String value types need to be quoted, but context variables are a special case of strings that don't need to be.
Added tests.
2022-10-18 20:09:25 +02:00
derekpierre
d158221794
Add '!=' comparator as a valid comparator for ReturnValueTest.
...
Updated tests.
2022-10-18 20:09:25 +02:00
derekpierre
0379ce7114
Parameter types for ContractConditions do not have to be strings - we need to be careful with types when checking whether a parameter is a context variable or not.
...
ERC721 ownerOf function takes an int and not a string which caused failures.
Added/updated tests.
2022-10-18 20:09:25 +02:00
David Núñez
36e5368f3c
Add more basic unit tests for ReturnValueTest
2022-10-18 20:09:25 +02:00
David Núñez
7219c749ba
Sanitize input to constructor of ReturnValueTest
2022-10-18 20:09:25 +02:00
David Núñez
56af2bf27f
Basic unit test for ConditionLingo
2022-10-18 20:09:25 +02:00
David Núñez
7c976751b0
Playing around with malicious input that exploits the use of eval()
...
This test creates an empty file in the filesystem when evaluating a condition. This shouldn't happen! We fix it later in this PR by using the ast module
2022-10-18 20:09:25 +02:00
derekpierre
f972c72470
Code cleanup to condition context variable - follow up RFCs from #2966 .
2022-10-18 20:09:25 +02:00
derekpierre
7e8d9eb7f1
Modify tests to use context instead of python parameters. Add test for use of user customized context variable.
...
Cleanup some test code.
2022-10-18 20:09:25 +02:00
derekpierre
f164cfb3a9
Clenup of tests regarding `context`. Minor fix for using lists for ConditionLingo conditions instead of tuple.
2022-10-18 20:09:25 +02:00
KPrasch
cd11a414bc
Apply suggestions from code review
...
Co-authored-by: Derek Pierre <derek.pierre@gmail.com>
2022-10-18 20:09:25 +02:00
Kieran Prasch
b7145c0ab4
Remove core shims; Refactor for mk-embedded conditions.
2022-10-18 20:08:51 +02:00
derekpierre
8a482d9389
Ensure delimiter is used as a single byte, and not a bunch of 0 bytes. Fixed test.
2022-10-18 20:07:58 +02:00
Kieran Prasch
72c6bd5295
Refactoring for interop with nucypher-ts
2022-10-18 20:07:58 +02:00
Kieran Prasch
74a0465cf3
Track lingos and capsules as packets; First working e2e flow.
2022-10-18 20:07:58 +02:00
Kieran Prasch
249c74eb31
Updates tests
2022-10-18 20:07:58 +02:00
Kieran Prasch
2948a198c0
Unit and acceptance tests for condition serialization and evaluation
2022-10-18 20:07:10 +02:00
Kieran Prasch
8d2045a118
conditions expression and evaluation prototype
2022-10-18 20:07:10 +02:00
Kieran Prasch
9e763dad86
expand test vectors
2022-10-18 20:07:10 +02:00
Kieran Prasch
5d4d409b82
Consolidates evm based reencryption conditions to eventually encapsulate payment methods; Reduce scope of conditions to a module
2022-10-18 20:07:10 +02:00
Kieran Prasch
58f4b6e50a
Begin sanitization of return test comparators
2022-10-18 20:06:39 +02:00
Kieran Prasch
34bd940976
Establish unit tests for conditions
2022-10-18 20:06:39 +02:00