Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remote state reads #967

Merged
merged 60 commits into from
Mar 25, 2021
Merged

Remote state reads #967

merged 60 commits into from
Mar 25, 2021

Conversation

jjcnn
Copy link
Contributor

@jjcnn jjcnn commented Mar 12, 2021

No description provided.

jjcnn and others added 30 commits January 22, 2020 19:42
* Define Address type
* Define legal Address types for messages, parameters and fields.
* Added address type to syntax, and fixed ambiguous grammar

* Add location info to Address field identifiers
* assert_type_assignable

* Use assert_type_assignable in TypeUtil.

* Type inference rules for address types

* Fix type_assignable and tests of same, introduce legal_procedure_parameter_type, and fix parser bug

* Fix parser bug and typechecker issue

* Refactor type equivalence tests

* Assignable tests

* Duplicate field check for address types

* Remove fixed TODO

* Move duplicate field check to Recursion.ml

* Remove blank line

* Reintroduce is_ground_type

* Cosmetic change to pp_typ in case the address contains no fields

* Addresses from JSONs should be read as ByStr20s

* Reorder arguments to for_all2_exn in builtin argument traversal

* Do not use type_assignable when comparing types derived from literal values

* Use type_equiv in Schnorr calculations, and rename json_to_lit to json_to_lit_exn
* Remote state read syntax and typechecking

* _balance field must be accessible even when not declared

* Change <- to <-- for remote reads

* Add address type to map key and value types

* Removed incorrect comment
* Fixed two bugs re. initialisers for address fields.

* Update src/base/TypeChecker.ml

Co-Authored-By: Vaivaswatha N <vaivaswatha@users.noreply.github.com>

Co-authored-by: Vaivaswatha N <vaivaswatha@users.noreply.github.com>
* Add IPC methods to fetch external contract state

* Provide means to specify external states via input JSONs

* Add a dummy fetch_ext_state_value to StateIPCTestServer

* Provide external_fetch service in StateService.ml
* Fix outstanding merge issues

* fmt

* Use assert_type_assignable rather than assert_type_equiv

* fmt
* _sender is an address, eq should compare addresses as ByStr20

* Added addresses as legal ADT constructor arguments

* Addresses in event fields output as ByStr20

* fmt
* Name parameters to type_assignable and assert_type_assignable

* address_typ to construct address type nodes

* fmt
jjcnn and others added 13 commits March 8, 2021 12:56
state parser in the blockchain unit test which cannot know if
its a map or not (yet).

I ended up running `make fmt` which resulted in some other changes
as well, but just whitespace changes.

Co-authored-by: Jacob Johannsen <jajocnn@gmail.com>
* Fix missing stuff in #956

* Change _this_address of test contract

* Update owner address and balance (to cover gas fee in C++ test)
* Added nonce check

* Tests for nonce > 0 || balance > 0
* Added nonce check

* Tests for nonce > 0 || balance > 0

* Changed remote read operator from <-- to <-&

* Change address type syntax

* Remove _this_address production from address_type_field

* Remove _this_address from Address AST nodes

* make fmt
* Equality tests on address types

* Non-storable types not allowed in address fields. Contract parameters checked for serializability. eq tests on addresses

* Address list traversal tests

* Namespaces not allowed when remote reading

* Polymorphic address types

* Test remote read from non-address

* Additional negative remote read tests

* Test of deep remote reads

* Various deep remote reads tests

* Fix problem map builtins on maps with addresses as key types

* Only address argument types to put should be converted to ByStr20

* fmt

* Merge fixes
* Disable check. Another check needs to be enabled before merging

* Allow maps as contract parameters

* Validate contract parameters

* fmt
@jjcnn jjcnn marked this pull request as draft March 18, 2021 08:00
@jjcnn
Copy link
Contributor Author

jjcnn commented Mar 18, 2021

Converting to draft PR, as some tests are failing.

@jjcnn jjcnn marked this pull request as ready for review March 24, 2021 21:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants