Skip to content
This repository was archived by the owner on Nov 15, 2023. It is now read-only.

Conversation

@pepyakin
Copy link
Contributor

@pepyakin pepyakin commented Sep 6, 2019

This PR adds a new custom RPC to node that allows users to call a contract with the current state and receive the output buffer. This is unlike to the executive, where it is not possible to return a result of contract execution.

This feature will help us in writing srml-contracts integration tests, right now we are checking the result of execution by querying the hardcoded storage entries which is not ideal, calling getters would be more convenient.

I believe that the runtime behavior didn't change, hence incrementing only impl_version.

TODO / Follow-ups:

  • Tests. This is tricky one, because the setup might get quite complicated. However, after a discussion with @tomusdrw, we came to conclusion that it might be not required since the code is rather trivial and the mocking would add extra complexity. So it might be better tested in E2E fashion. This is actually the plan since we need this PR for integration tests. Also, @tomusdrw mentioned that we might want to explore the way of auto-generation of these bindings.
  • A similar RPC method for instantiation of a contract.
  • Probably another for put_code. That would allow to check if a contract is deployable locally.

@pepyakin pepyakin added A3-in_progress Pull request is in progress. No review needed at this stage. A0-please_review Pull request needs code review. and removed A3-in_progress Pull request is in progress. No review needed at this stage. labels Sep 6, 2019
@pepyakin pepyakin marked this pull request as ready for review September 6, 2019 13:13
Copy link
Contributor

@tomusdrw tomusdrw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm! Tiny grumble about RPC call parameters.

@pepyakin pepyakin merged commit 042b26d into master Sep 12, 2019
@pepyakin pepyakin deleted the ser-contracts-rpc-call branch September 12, 2019 11:30
andresilva pushed a commit that referenced this pull request Sep 17, 2019
* Sketch

* Some work on docs.

* Doc improvements.

* More docs.

* Some more docs.

* Yet another comment.

* Bump impl_version.

* Accept the block hash

* Use NumberOrHex

* Update node/rpc/src/contracts.rs

Co-Authored-By: Tomasz Drwięga <[email protected]>

* Move rpc/primitives
Demi-Marie pushed a commit to Demi-Marie/substrate that referenced this pull request Sep 17, 2019
* Sketch

* Some work on docs.

* Doc improvements.

* More docs.

* Some more docs.

* Yet another comment.

* Bump impl_version.

* Accept the block hash

* Use NumberOrHex

* Update node/rpc/src/contracts.rs

Co-Authored-By: Tomasz Drwięga <[email protected]>

* Move rpc/primitives
en pushed a commit to en/substrate that referenced this pull request Sep 24, 2019
* Sketch

* Some work on docs.

* Doc improvements.

* More docs.

* Some more docs.

* Yet another comment.

* Bump impl_version.

* Accept the block hash

* Use NumberOrHex

* Update node/rpc/src/contracts.rs

Co-Authored-By: Tomasz Drwięga <[email protected]>

* Move rpc/primitives
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

A0-please_review Pull request needs code review.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants