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

Add RPC to run constructors #7379

Closed
athei opened this issue Oct 23, 2020 · 2 comments · Fixed by #8451
Closed

Add RPC to run constructors #7379

athei opened this issue Oct 23, 2020 · 2 comments · Fixed by #8451
Labels
J0-enhancement An additional feature request.

Comments

@athei
Copy link
Member

athei commented Oct 23, 2020

Currently, the UI can use the contract_call in order to determine gas costs of a call. However, this is not possible when deploying because there is no RPC that allows running a constructor.

Add a rpc contracts_construct(code_hash, input) -> (ExecResult, ConsumedGas) to allow for gas estimation on deploy.

@jacogr

@athei athei added the J0-enhancement An additional feature request. label Oct 23, 2020
@ayushmishra2005
Copy link
Contributor

@athei Is below abstraction right?

#[rpc(name = "contracts_construct")]
fn construct(
	&self,
	address: AccountId,
	at: Option<BlockHash>,
) -> Result<Option<ConsumedGas>>;

Please guide me for the implementation part.

@athei
Copy link
Member Author

athei commented Oct 25, 2020

I am not exactly sure how this will look like because this depends on the changes that will happen to instantiation due to code rent. Adding a new RPC before those are makes no sense.

This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
J0-enhancement An additional feature request.
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

2 participants