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

Implement seal_code_hash and seal_own_code_hash #1205

Merged
merged 20 commits into from Apr 8, 2022
Merged

Implement seal_code_hash and seal_own_code_hash #1205

merged 20 commits into from Apr 8, 2022

Conversation

agryaznov
Copy link
Contributor

Follow-up for substrate#10933.
Resolves #1204.

@agryaznov agryaznov force-pushed the ag-code-hash branch 2 times, most recently from 891f434 to 6a85959 Compare March 31, 2022 18:32
@paritytech-cicd-pr
Copy link

paritytech-cicd-pr commented Apr 1, 2022

🦑 📈 ink! Example Contracts ‒ Changes Report 📉 🦑

These are the results when building the examples/* contracts from this branch with cargo-contract 1.1.1-1e8dd91 and comparing them to ink! master:

Δ Optimized Size Δ Used Gas Total Optimized Size Total Used Gas
accumulator 1.03 K
adder 2.17 K
contract-introspection 2.37 K
contract-terminate 0.94 K 213_894
contract-transfer 8.15 K 13_894
delegate-calls 2.99 K 14_417
delegator 6.37 K 44_669
dns 8.84 K 41_682
erc1155 17.23 K 83_364
erc20 8.49 K 41_682
erc721 11.81 K 111_152
flipper 1.31 K 13_894
forward-calls 2.90 K 28_475
incrementer 1.21 K 13_894
multisig 25.20 K 90_207
rand-extension 3.92 K 13_894
subber 2.19 K
trait-erc20 8.76 K 41_682
trait-flipper 1.00 K 13_894
trait-incrementer 1.19 K 27_788
upgradeable-flipper 1.55 K

Link to the run | Last update: Fri Apr 8 19:08:26 CEST 2022

@codecov-commenter
Copy link

codecov-commenter commented Apr 1, 2022

Codecov Report

Merging #1205 (1114083) into master (1aafcb1) will increase coverage by 17.28%.
The diff coverage is n/a.

❗ Current head 1114083 differs from pull request most recent head 12901dc. Consider uploading reports for the commit 12901dc to get more accurate results

@@             Coverage Diff             @@
##           master    #1205       +/-   ##
===========================================
+ Coverage   61.69%   78.98%   +17.28%     
===========================================
  Files         228      229        +1     
  Lines        8637     8667       +30     
===========================================
+ Hits         5329     6846     +1517     
+ Misses       3308     1821     -1487     
Impacted Files Coverage Δ
crates/env/src/api.rs 33.33% <ø> (+9.52%) ⬆️
crates/env/src/backend.rs 83.33% <ø> (ø)
crates/env/src/engine/off_chain/impls.rs 43.03% <ø> (+8.22%) ⬆️
crates/lang/src/env_access.rs 12.00% <ø> (ø)
crates/allocator/src/bump.rs 0.00% <0.00%> (ø)
crates/storage/src/traits/impls/prims.rs 96.92% <0.00%> (+1.53%) ⬆️
...ates/storage/src/collections/hashmap/fuzz_tests.rs 95.74% <0.00%> (+2.12%) ⬆️
crates/lang/ir/src/ir/attrs.rs 82.27% <0.00%> (+3.60%) ⬆️
crates/metadata/src/layout/mod.rs 77.01% <0.00%> (+4.59%) ⬆️
crates/lang/ir/src/ir/trait_def/item/mod.rs 90.16% <0.00%> (+4.91%) ⬆️
... and 55 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 1aafcb1...12901dc. Read the comment docs.

crates/env/src/api.rs Outdated Show resolved Hide resolved
@@ -514,6 +514,22 @@ where
})
}

/// Retrieves the code hash of a contract living at specified account
Copy link
Collaborator

Choose a reason for hiding this comment

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

Could you also add a section /// # Errors here?

<EnvInstance as OnInstance>::on_instance(|instance| instance.code_hash::<E>(account))
}

/// Retrieves the code hash of the currently executing contract.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Could you also add a section /// # Errors here?

crates/env/src/backend.rs Outdated Show resolved Hide resolved
crates/env/src/engine/off_chain/impls.rs Outdated Show resolved Hide resolved
crates/env/src/engine/off_chain/impls.rs Outdated Show resolved Hide resolved
crates/lang/src/env_access.rs Outdated Show resolved Hide resolved
agryaznov and others added 2 commits April 4, 2022 19:01
@agryaznov agryaznov requested a review from cmichi April 6, 2022 17:41
crates/env/src/api.rs Outdated Show resolved Hide resolved
crates/env/src/backend.rs Outdated Show resolved Hide resolved
Co-authored-by: Michael Müller <mich@elmueller.net>
agryaznov and others added 3 commits April 8, 2022 17:13
Co-authored-by: Michael Müller <mich@elmueller.net>
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.

Add code_hash and code_own_hash
4 participants