This repository was archived by the owner on Nov 15, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Contracts add code_len to ContractsInfo #14523
Merged
Merged
Changes from all commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
9ceaa82
add code_len to v12
pgherveou 094922d
fix
pgherveou c17ebcd
Update frame/contracts/src/wasm/mod.rs
pgherveou 0d0bcc4
fix
pgherveou 97a2745
fixes
pgherveou 6cb2c10
rm test
pgherveou bed614f
add test back
pgherveou 138397b
fix
pgherveou 5775961
update test
pgherveou 0080d7a
Fix comments
pgherveou 3964a04
fix build
pgherveou dee9351
del
pgherveou 8646e65
fix clippy
pgherveou 5ea7fd7
fix
pgherveou 0fe17b2
re-rename
pgherveou 65173cc
Merge branch 'master' into pg/add_code_len
pgherveou File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,33 @@ | ||
| pub use pallet::*; | ||
|
|
||
| #[frame_support::pallet(dev_mode)] | ||
| pub mod pallet { | ||
| use frame_support::{ | ||
| dispatch::{Pays, PostDispatchInfo}, | ||
| pallet_prelude::DispatchResultWithPostInfo, | ||
| weights::Weight, | ||
| }; | ||
| use frame_system::pallet_prelude::*; | ||
|
|
||
| #[pallet::pallet] | ||
| pub struct Pallet<T>(_); | ||
|
|
||
| #[pallet::config] | ||
| pub trait Config: frame_system::Config {} | ||
|
|
||
| #[pallet::call] | ||
| impl<T: Config> Pallet<T> { | ||
| /// Dummy function that overcharges the predispatch weight, allowing us to test the correct | ||
| /// values of [`ContractResult::gas_consumed`] and [`ContractResult::gas_required`] in | ||
| /// tests. | ||
| #[pallet::call_index(1)] | ||
| #[pallet::weight(Weight::from_parts(10_000_000, 0))] | ||
| pub fn overestimate_pre_charge(origin: OriginFor<T>) -> DispatchResultWithPostInfo { | ||
| ensure_signed(origin)?; | ||
| Ok(PostDispatchInfo { | ||
| actual_weight: Some(Weight::from_parts(100, 0)), | ||
| pays_fee: Pays::Yes, | ||
| }) | ||
| } | ||
pgherveou marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| } | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.