RGB-WG / rgb-std

RGB standard libs for WASM & low-level integrations (no FS/networking)
https://rgb.tech
Apache License 2.0
66 stars 30 forks source link

collect supplements in issue contract #231

Closed cymqqqq closed 3 months ago

cymqqqq commented 4 months ago

Description:

add collect supplements feature for the issue_contract, includes the following Supplement instance:

genesis supplement iface supplement iimpl supplement schema supplement

codecov[bot] commented 4 months ago

Codecov Report

Attention: Patch coverage is 50.00000% with 8 lines in your changes missing coverage. Please review.

Project coverage is 18.1%. Comparing base (7f637c6) to head (e599ba1). Report is 1 commits behind head on master.

Files Patch % Lines
src/interface/builder.rs 50.0% 8 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #231 +/- ## ======================================== + Coverage 17.6% 18.1% +0.6% ======================================== Files 37 37 Lines 7535 7548 +13 ======================================== + Hits 1323 1369 +46 + Misses 6212 6179 -33 ``` | [Flag](https://app.codecov.io/gh/RGB-WG/rgb-std/pull/231/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=RGB-WG) | Coverage Δ | | |---|---|---| | [rust](https://app.codecov.io/gh/RGB-WG/rgb-std/pull/231/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=RGB-WG) | `18.1% <50.0%> (+0.6%)` | :arrow_up: | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=RGB-WG#carryforward-flags-in-the-pull-request-comment) to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

dr-orlovsky commented 4 months ago

Why are you merging master? Just do rebases

cymqqqq commented 4 months ago

Sorry....I always use the update branch button, next time I'll try to git rebase main.

cymqqqq commented 4 months ago

I agree with you, the first idea is to collect supplements from the stash, but the question is: do we have a stash when we issue a contract? (In the consign method, yes, there is already a stash so we can collect supplements from the stash.) I just found ContractBuilder, and after we finish the contract issue, then initialize a stock(MemStash, MemState, and MemIndex), and then we can import the kit and contract to the stash.

dr-orlovsky commented 4 months ago

When you issue contract you need to collect just supplements for interfaces, schema and implementation. There is no "genesis supplement" which can be found in the stash.

You also need to keep in mind that right now there is no supplements which exist - this functionality is there only as a way to add new things in the future.