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(pop-api): implement pop api crate, chain extension, and demo contracts #20

Merged
merged 13 commits into from
Mar 6, 2024

Conversation

peterwht
Copy link
Collaborator

@peterwht peterwht commented Mar 6, 2024

The Pop API enables contracts to easily access runtime capabilities. This is done through:

  • A chain extension that parses calls from the contracts and dispatches extrinsics or queries state
  • The pop-api crate which predefines interfaces and environments for contracts to import and use.

peterwht and others added 13 commits March 6, 2024 00:41
* ci: add build workflow

* chore: improve zombienet config

* ci: grant write permission to actions

* feat: initialize pop-api directory

* feat: add codec indexes, and wrap NFT interface

* feat: add example contract utilizing pop-api crate -- not working

* feat: minting NFT from contract through runtime works

* feat pop api crate refactoring and test (#15)

* refactor: simplify api usage from contract

* test: add NFT mint unit test to pop api extension

---------

Co-authored-by: Frank Bell <[email protected]>

---------

Co-authored-by: Frank Bell <[email protected]>
* demo_contract:query_runtime

* pop-api-ext:query

* read relay_block# & state

* unused import

* ci: add build workflow

* chore: improve zombienet config

* ci: grant write permission to actions

* feat: initialize pop-api directory

* feat: add codec indexes, and wrap NFT interface

* feat: add example contract utilizing pop-api crate -- not working

* feat: minting NFT from contract through runtime works

* feat: generic state reads

* chore: fmt

* RuntimeStateKeys

* clean keys

* fmt

* cumulus_parachain_system is accessible

---------

Co-authored-by: Frank Bell <[email protected]>
Co-authored-by: Peter White <[email protected]>
* feat: PoC of chain-extension reimplementing call_runtime

* feat: use proper origin for pop api chain extension, start weight calculations

* feat: start adding unit test for pop api chain extension

* chore: update cargo.lock

* feat: unit test works for pop api chain extension

* chore: cargo fmt

* feat: pop api crate (#16)

* ci: add build workflow

* chore: improve zombienet config

* ci: grant write permission to actions

* feat: initialize pop-api directory

* feat: add codec indexes, and wrap NFT interface

* feat: add example contract utilizing pop-api crate -- not working

* feat: minting NFT from contract through runtime works

* feat pop api crate refactoring and test (#15)

* refactor: simplify api usage from contract

* test: add NFT mint unit test to pop api extension

---------

Co-authored-by: Frank Bell <[email protected]>

---------

Co-authored-by: Frank Bell <[email protected]>

* feat: add secure weight charging for pop-api extension

* chore: update zombienet config

* feat: query_state & pop_api_primitives (#14)

* demo_contract:query_runtime

* pop-api-ext:query

* read relay_block# & state

* unused import

* ci: add build workflow

* chore: improve zombienet config

* ci: grant write permission to actions

* feat: initialize pop-api directory

* feat: add codec indexes, and wrap NFT interface

* feat: add example contract utilizing pop-api crate -- not working

* feat: minting NFT from contract through runtime works

* feat: generic state reads

* chore: fmt

* RuntimeStateKeys

* clean keys

* fmt

* cumulus_parachain_system is accessible

---------

Co-authored-by: Frank Bell <[email protected]>
Co-authored-by: Peter White <[email protected]>

* fix: failing contract builds

* refactor: general refactoring, versioned function selector and code cleanup

* feat(pop-api): errors

* refactor: improve error handling

* chore: tidy up manifest

* clean & rename tests

* refactor: clean up and simplify

* test: ignore tests which expect built contracts

* style: formatting

---------

Co-authored-by: Frank Bell <[email protected]>
Co-authored-by: Alejandro Martinez Andres <[email protected]>
Co-authored-by: Frank Bell <[email protected]>
@peterwht peterwht merged commit 27da803 into main Mar 6, 2024
5 checks passed
@peterwht peterwht deleted the feat/pop-api branch April 9, 2024 02:57
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.

3 participants