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

al3mart/query_state & pop_api_primitives #14

Merged
merged 22 commits into from
Mar 4, 2024

Conversation

al3mart
Copy link
Collaborator

@al3mart al3mart commented Feb 29, 2024

This merge request implements a first version of pop-api: block number querying and prepares the ground for general runtime state reads.

It implements the enum SafeKeys, which if not changing the approach, should be moved out of this repository into pop-api. So that both, contracts and runtime can depend on and have a shared understanding.

At the same time restructures the extensions module in the following way:

extensions
|_ mod.rs
|_ pop_api_extension.rs
|_ext_impl
   \_dispatch.rs
    |_ read_state.rs
    |_ mod.rs
  • chain extension tests ready
  • contract tests ready

EDIT:

Still no tests, but there is a contract implementing reading state from the runtime.
Refactors SafeKeys into RuntimeStateKeys
Introduces pop-api-primitives
Merges branch feat/pop-api-crate -> Contracts can now use nfts :D 🎉

@al3mart al3mart self-assigned this Feb 29, 2024
@al3mart al3mart changed the title Al3mart/query relay number al3mart/query relay number Feb 29, 2024
@al3mart al3mart changed the title al3mart/query relay number al3mart/query_state & pop-primitives Mar 2, 2024
@al3mart al3mart changed the title al3mart/query_state & pop-primitives al3mart/query_state & pop_api_primitives Mar 2, 2024
@al3mart al3mart marked this pull request as ready for review March 4, 2024 16:04
@peterwht peterwht merged commit 64ba54d into feat/pop-api Mar 4, 2024
1 check passed
@peterwht peterwht deleted the al3mart/query_relay_number branch March 4, 2024 17:01
evilrobot-01 added a commit that referenced this pull request Mar 6, 2024
* 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 <frank@r0gue.io>
Co-authored-by: Peter White <petras9789@gmail.com>
evilrobot-01 added a commit that referenced this pull request Mar 6, 2024
* 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 <frank@r0gue.io>
Co-authored-by: Peter White <petras9789@gmail.com>
peterwht added a commit that referenced this pull request Mar 6, 2024
* 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 <frank@r0gue.io>

---------

Co-authored-by: Frank Bell <frank@r0gue.io>

* 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 <frank@r0gue.io>
Co-authored-by: Peter White <petras9789@gmail.com>

* 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 <frank@r0gue.io>
Co-authored-by: Alejandro Martinez Andres <11448715+al3mart@users.noreply.github.com>
Co-authored-by: Frank Bell <60948618+evilrobot-01@users.noreply.github.com>
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