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

feat(dan): invocation of functions in templates #4343

Merged
merged 11 commits into from
Jul 26, 2022

Conversation

mrnaveira
Copy link
Contributor

Description

  • New template test that simulates a component with state, a constructor and get/set methods
    • For now we don't perform real calls to handle state and constructor calls as we don't have those implemented yet
  • Renamed existing template test to a more proper "hello world" name
  • Refactor of all template wasm compilation/execution/test into reusable functions, as much as possible without macros:
    • Template test initialization and invocation
    • Generation of template ABI code
    • Generation of template wasm code, allowing for multiple functions with different signatures

Motivation and Context

One of the next steps in template wasm compilation and execution is the implementation of a more complex example with multiple functions. We also want to refactor as much as possible all common code between examples

How Has This Been Tested?

The new units test for the templates pass

sdbondi
sdbondi previously approved these changes Jul 26, 2022
Copy link
Member

@sdbondi sdbondi left a comment

Choose a reason for hiding this comment

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

Looks good, I think the approach can be refined from here.

dan_layer/engine/tests/state/src/lib.rs Show resolved Hide resolved
dan_layer/engine/tests/common/src/lib.rs Outdated Show resolved Hide resolved
dan_layer/engine/tests/state/src/lib.rs Outdated Show resolved Hide resolved
Copy link
Member

@sdbondi sdbondi left a comment

Choose a reason for hiding this comment

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

LGTM 🎉

@aviator-app aviator-app bot merged commit 3d92eb0 into tari-project:development Jul 26, 2022
@mrnaveira mrnaveira deleted the contract-functions branch July 26, 2022 13:00
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