Skip to content

Change the API of execute_message #4271

@MathieuDutSik

Description

@MathieuDutSik

Currently, the execute_message is taking just an operation: Vec<u8>.

There are other functions related to messages:

  • ContractRuntime::message_id that returns an Option<MessageId>.
  • ContractRuntime::message_is_bouncing that returns an Option<bool>.

The behavior is as follows:

  • When the execution context is an execute_message, the results are some Some(...).
  • In other contexts, it is a None.

This is rather cumbersome, and it would probably be better to have the following API:

fn execute_message(&mut self, is_bouncing: bool, message_id: MessageId, message: Vec<u8>) -> Result<(), ExecutionError>

and remove the functions message_is_bouncing and message_id from the ContractRuntime.

This is not a critical protocol change, but would make life easier for developers.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions