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

Instantiate native contract #596

Merged
merged 22 commits into from
Jan 17, 2022
Merged

Instantiate native contract #596

merged 22 commits into from
Jan 17, 2022

Conversation

kvinwang
Copy link
Collaborator

@kvinwang kvinwang commented Dec 13, 2021

The PR implement native contract instantiation.

crates/phactory/src/contracts/support.rs Outdated Show resolved Hide resolved
crates/phactory/src/system/mod.rs Outdated Show resolved Hide resolved
crates/phactory/src/contracts/pink.rs Outdated Show resolved Hide resolved
Base automatically changed from pink-key-manage to master December 28, 2021 03:28
@kvinwang kvinwang marked this pull request as draft January 4, 2022 09:25
@kvinwang kvinwang marked this pull request as ready for review January 8, 2022 02:07
@@ -483,7 +488,34 @@ impl<Platform: pal::Platform> System<Platform> {
contract.handle_query(origin, req, &mut context)
}

pub fn process_messages(&mut self, block: &mut BlockInfo) -> anyhow::Result<()> {
pub fn process_next_message(&mut self, block: &mut BlockInfo) -> anyhow::Result<bool> {
Copy link
Contributor

Choose a reason for hiding this comment

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

What's the return value?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

        loop {
            match self.process_next_message(block) {
                Err(err) => {
                    error!("Error processing message: {:?}", err);
                }
                Ok(no_more) => {
                    if no_more {
                        break;
                    }
                }
            }
        }

@kvinwang kvinwang merged commit 1c740ad into master Jan 17, 2022
@kvinwang kvinwang deleted the instantiate-native branch January 17, 2022 12:40
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.

2 participants