Skip to content
This repository was archived by the owner on Nov 15, 2023. It is now read-only.
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
177 commits
Select commit Hold shift + click to select a range
acab2d1
paged exposure skeleton
Ank4n Jan 4, 2023
256ca4c
insignificant changes
Ank4n Jan 4, 2023
8e6db42
Merge branch 'master' into ankan/paged-rewards
Ank4n Jan 5, 2023
0cabf55
add note on usage of twox hash
Ank4n Jan 6, 2023
00bc992
Merge branch 'master' into ankan/paged-rewards
Ank4n Jan 6, 2023
f65d7b6
impl paged exposure
Ank4n Jan 6, 2023
e7f299c
paged as exposure function
Ank4n Jan 6, 2023
b3f58d6
add test for paging exposure
Ank4n Jan 6, 2023
661fab0
remove commented fn
Ank4n Jan 7, 2023
06d83fb
cargo fmt
Ank4n Jan 7, 2023
02e3ffc
more fmt
Ank4n Jan 7, 2023
c924bfc
remove unnecessary bound
Ank4n Jan 7, 2023
108cd16
add wrapper struct and refactor
Ank4n Jan 8, 2023
e14eab3
create temp fn that checks both ledger and new claimed_rewards
Ank4n Jan 8, 2023
70b8c7f
incomplete, paged extrinisic to pay stakers
Ank4n Jan 8, 2023
484dad8
Merge branch 'master' into ankan/paged-rewards
Ank4n Jan 9, 2023
eac23e0
fix names
Ank4n Jan 10, 2023
1cd79ff
add page as 0 for payout stakers, tests failing currently.
Ank4n Jan 14, 2023
4fdc2df
fix double claim
Ank4n Jan 14, 2023
c339ca5
don't store claimed rewards for previous eras in the ledger
Ank4n Jan 14, 2023
773d91c
mark claimed_rewards in Staking ledger as legacy
Ank4n Jan 14, 2023
f50ee11
test for not populating legacy claimed rewards anymore
Ank4n Jan 14, 2023
309c737
test is not accurate since for prebonded era, there cannot be any rew…
Ank4n Jan 14, 2023
4f4466c
fmt
Ank4n Jan 14, 2023
7f4aa5b
assert claimed rewards is populated
Ank4n Jan 14, 2023
d64d28e
introduce struct ExposurePage
Ank4n Jan 15, 2023
da53a27
fmt
Ank4n Jan 15, 2023
dd60ba7
some docs
Ank4n Jan 15, 2023
b19193a
rename to into_pages
Ank4n Jan 16, 2023
e3569bf
verify claimed rewards and era stakers is cleared
Ank4n Jan 16, 2023
99913b3
small comment
Ank4n Jan 16, 2023
cc6be46
reuse MaxNominatorRewardedPerValidator
Ank4n Jan 16, 2023
6623056
get to the same stage as 1st attempt
Ank4n Jan 18, 2023
90e7a9d
pay all pages
Ank4n Jan 21, 2023
cf6ee88
introduce invalid page error
Ank4n Jan 21, 2023
b86e3f8
docs
Ank4n Jan 21, 2023
1072147
test all nominators are paid
Ank4n Jan 21, 2023
9f4ea04
all test pass
Ank4n Jan 21, 2023
42429e9
cargo fmt
Ank4n Jan 21, 2023
4260bca
add more tests
Ank4n Jan 22, 2023
eb0709b
cargo fmt
Ank4n Jan 22, 2023
ec6ae58
fix benchmarks
Ank4n Jan 23, 2023
03c53a0
fix clippy suggestion
Ank4n Jan 23, 2023
f87a862
Merge branch 'master' into ankan/paged-rewards
Ank4n Jan 23, 2023
c94ce9c
Merge branch 'master' of https://github.com/paritytech/substrate into…
Jan 23, 2023
554bb7c
".git/.scripts/commands/bench/bench.sh" pallet dev pallet_staking
Jan 23, 2023
1aed1b5
doc for split into pages
Ank4n Jan 23, 2023
18d2d1d
remove unused from
Ank4n Jan 23, 2023
b14319e
fix doc
Ank4n Jan 23, 2023
0fa0195
rename MaxNominatorRewardedPerValidator
Ank4n Jan 23, 2023
2d5082d
add weight for pages other than 0
Ank4n Jan 23, 2023
ce67004
fmt
Ank4n Jan 23, 2023
c330866
use n to make the compiler happy
Ank4n Jan 23, 2023
99d19b7
fix minimum count
Ank4n Jan 23, 2023
fc2e091
correct number of nominators
Ank4n Jan 23, 2023
2adf060
fix benchmark and commission payout
Ank4n Jan 23, 2023
26efca4
refactor
Ank4n Jan 23, 2023
d7ab5b7
verify is paid only once per era for their own stake
Ank4n Jan 23, 2023
e77bd87
fmt
Ank4n Jan 23, 2023
6bc015f
fix rustdoc
Ank4n Jan 23, 2023
514a851
fmt
Ank4n Jan 23, 2023
076a0c1
".git/.scripts/commands/bench/bench.sh" pallet dev pallet_staking
Jan 23, 2023
cf0654b
fix rust doc
Ank4n Jan 23, 2023
94a6dd5
handles errors
Ank4n Jan 25, 2023
e49d721
commission test
Ank4n Jan 25, 2023
2f40eea
some things to discuss
Ank4n Jan 25, 2023
455294b
try state checks
Ank4n Jan 25, 2023
4e2b482
fmt
Ank4n Jan 25, 2023
416ee7e
Merge branch 'master' into ankan/paged-rewards
Ank4n Jan 25, 2023
478b473
Revert "try state checks"
Ank4n Jan 25, 2023
ddfcd18
cleanup era overview in history depth eras
Ank4n Jan 25, 2023
75fb102
Merge branch 'master' into ankan/paged-rewards
Ank4n Jan 28, 2023
fed66ce
todos
Ank4n Jan 28, 2023
aeec825
remove store
Ank4n Jan 31, 2023
a85e451
[Revert] keep the same name of page size
Ank4n Jan 31, 2023
b832130
consume exposure
Ank4n Jan 31, 2023
5d215c6
sc-finality-grandpa: Warp proof generation can not expect justificati…
bkchr Jan 28, 2023
d7e4a56
update criterion to v0.4.0 (#13142)
koushiro Jan 28, 2023
3ec6576
fix up template (#13205)
shawntabrizi Jan 29, 2023
dca583b
Remove `uncles` related code (#13216)
bkchr Jan 29, 2023
b0e04e7
Implement RIType traits for u8 array with an arbitrary size (#13256)
conr2d Jan 30, 2023
2d35736
grandpa: cleanup stale entries in set id session mapping (#13237)
andresilva Jan 30, 2023
599cd6e
Benchmark's successful origin api update (#13146)
muharem Feb 1, 2023
4ff092b
hooks default impl missing where clause (#13264)
kianenigma Feb 1, 2023
0d47b62
implemented `contains_prefix` for StorageDoubleMap and StorageNMap (#…
muraca Feb 1, 2023
f88a55e
Calling proxy doesn't remove announcement (#13267)
Szegoo Feb 1, 2023
da40ff1
Fee and tip represented as asset ID inside `AssetTxFeePaid` (#13083)
Szegoo Feb 2, 2023
c9310e1
Move beefy-merkle-tree to utils/binary-merkle-tree and make it generi…
DaviRain-Su Feb 2, 2023
4d02469
Metadata V15: Derive `TypeInfo` for describing runtime types (#13272)
lexnv Feb 2, 2023
369365e
benchmarks: EnsureRankedMember must add ranked members (#13297)
ggwpez Feb 2, 2023
c6c490d
Minor: Update output validity tests (#13190)
mrcnski Feb 2, 2023
6453a4a
BEEFY: define on-chain beefy-genesis and use it to coordinate voter i…
acatangiu Feb 3, 2023
ff8a71f
feat: add event SkepticsChosen event in society (#13291)
gitofdeepanshu Feb 3, 2023
ca58b7b
feat(client): significantly increase wasm instance limits (#13298)
hussein-aitlahcen Feb 3, 2023
8866597
Remove in-tree bounded types and use bounded-collections crate (#13243)
KiChjang Feb 3, 2023
f28e182
some new definitions
Ank4n Feb 5, 2023
ab79cd3
new call to payout staekers by page
Ank4n Feb 5, 2023
50690ff
fix benchmark
Ank4n Feb 5, 2023
664c374
keep payout_stakers backward compatible
Ank4n Feb 5, 2023
bf41253
split exposure by ExposurePageSize
Ank4n Feb 5, 2023
caeb781
return both overview and page
Ank4n Feb 5, 2023
3b9acbf
fmt
Ank4n Feb 5, 2023
9ab601a
Update frame/staking/README.md
Ank4n Feb 6, 2023
7f24aa1
introduce exposure extension
Ank4n Feb 6, 2023
1bf6161
doc
Ank4n Feb 6, 2023
21dff20
format
Ank4n Feb 6, 2023
171d43b
pay commission in parts; failing tests
Ank4n Feb 6, 2023
263894b
verify commission are paid across pages
Ank4n Feb 6, 2023
78f94bc
fmt
Ank4n Feb 6, 2023
806e656
docs
Ank4n Feb 6, 2023
e826056
fix test
Ank4n Feb 6, 2023
bd420b3
Merge branch 'master' into ankan/paged-rewards
Ank4n Feb 7, 2023
5ae9ee8
only use one constant
Ank4n Feb 7, 2023
641d112
payout_stakers still work nicely
Ank4n Feb 7, 2023
0f76c59
remove todo
Ank4n Feb 7, 2023
37d46b6
benchmark against implicit page payout stakers since thats worst case
Ank4n Feb 7, 2023
406d3b8
add a working draft of changelog
Ank4n Feb 8, 2023
bfdd143
small doc update
Ank4n Feb 8, 2023
f2fd8d4
Fix block pruning (#13323)
arkpar Feb 7, 2023
58eef2c
Referendum proposal's metadata (#12568)
muharem Feb 8, 2023
b107674
Improve test coverage of the `Notifications` protocol (#13033)
altonen Feb 8, 2023
4123495
Configurable voting-degree in council elections pallet (#13305)
kianenigma Feb 8, 2023
23fb86b
Rework generated API docs (#13178)
athei Feb 8, 2023
be6a11c
pallet-scheduler: Ensure we request a preimage (#13340)
bkchr Feb 9, 2023
4b23fdb
[Fix] Try-state feature-gated for BagsList (#13296)
ruseinov Feb 9, 2023
821ad7e
bump version of zombienet and update snaps links (#13359)
pepoviola Feb 10, 2023
826cfb2
Fix longest chain finalization target lookup (#13289)
davxy Feb 11, 2023
71432c2
SetMembers configurable origin (#13159)
girazoki Feb 12, 2023
bfe5a7d
have a way to disable pages
Ank4n Feb 12, 2023
02703c7
fmt
Ank4n Feb 12, 2023
b79e231
simple rename
Ank4n Feb 12, 2023
77ba7df
test for page size and count
Ank4n Feb 12, 2023
ff965e2
add the old test back
Ank4n Feb 12, 2023
8a608f9
update changelog
Ank4n Feb 12, 2023
fef9db6
Merge branch 'master' of github.com:paritytech/substrate into ankan/p…
kianenigma Feb 14, 2023
a7bb9ed
Merge remote-tracking branch 'origin/master' into ankan/paged-rewards
Feb 14, 2023
dd6989c
Merge branch 'ankan/paged-rewards' of github.com:paritytech/substrate…
kianenigma Feb 14, 2023
64aa36b
Merge branch 'master' into ankan/paged-rewards
Ank4n Feb 14, 2023
397e5d2
remove duplicate test
Ank4n Feb 14, 2023
73630b4
todo tags
Ank4n Feb 15, 2023
cb59ca7
some renames and config vals
Ank4n Feb 15, 2023
a82b0bd
do not iterate twice
Ank4n Feb 15, 2023
e8ebbbc
rename
Ank4n Feb 15, 2023
9a959e4
clean up
Ank4n Feb 15, 2023
f712e35
pr fixes
Ank4n Feb 15, 2023
dfe8a98
fmt
Ank4n Feb 15, 2023
e2bf7cf
make it compile
Ank4n Feb 15, 2023
d08ffd5
Merge branch 'master' into ankan/paged-rewards
Ank4n Feb 18, 2023
d79d897
keep only config item for MaxExposurePageSize
Ank4n Feb 19, 2023
5a1f446
safe maths
Ank4n Feb 19, 2023
08d60ff
pr comment
Ank4n Feb 19, 2023
b929439
simplify next claimable page
Ank4n Feb 19, 2023
7df30f6
fix build
Ank4n Feb 19, 2023
4a415e7
pr comments
Ank4n Feb 19, 2023
8544412
clippy suggestion
Ank4n Feb 20, 2023
04133ab
Merge branch 'ankan/paged-rewards' of github.com:paritytech/substrate…
kianenigma Feb 20, 2023
0ce2bbd
write a new eras stakers
Ank4n Feb 20, 2023
ed8c993
clean up page_count
Ank4n Feb 20, 2023
2634403
more readable validator exposure calculation
Ank4n Feb 20, 2023
5f5abad
fmt
Ank4n Feb 20, 2023
9ad77cb
do not use ErasStakers anymore
Ank4n Feb 20, 2023
7dfb3e8
defensive unwrap for appending nominator pages to eras stakers
Ank4n Feb 20, 2023
fd2f6fb
better fn naming
Ank4n Feb 20, 2023
45ad6e1
fmt
Ank4n Feb 20, 2023
d49de8b
move logic to combine all exposure into EraInfo
Ank4n Feb 20, 2023
c67e8bd
remove useless getters
Ank4n Feb 20, 2023
06627f0
bounded ExposureOverview
Ank4n Feb 20, 2023
89820f9
remove unused fn
Ank4n Feb 20, 2023
66c8fe1
ErasStakers backward compatible test
Ank4n Feb 22, 2023
b5fa46e
fmt
Ank4n Feb 22, 2023
12ed262
update changelog
Ank4n Feb 22, 2023
14bc8b3
Use NMap for ErasStakersPaged
Ank4n Feb 22, 2023
6ac7961
doc update
Ank4n Feb 22, 2023
af01a1f
Merge branch 'master' of https://github.com/paritytech/substrate into…
Feb 22, 2023
b5190b5
".git/.scripts/commands/bench/bench.sh" pallet dev pallet_staking
Feb 22, 2023
21c20f2
rename to consistent names
Ank4n Feb 22, 2023
2aa08d6
some docs
Ank4n Feb 26, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Metadata V15: Derive TypeInfo for describing runtime types (#13272)
* scale_info: Derive TypeInfo for types present in runtime API

Signed-off-by: Alexandru Vasile <[email protected]>

* cargo: Update Cargo.lock

Signed-off-by: Alexandru Vasile <[email protected]>

---------

Signed-off-by: Alexandru Vasile <[email protected]>
  • Loading branch information
lexnv authored and Ank4n committed Feb 5, 2023
commit 4d02469dfe1c11466b45a9779dd36014ee549b27
3 changes: 3 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions client/consensus/babe/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ targets = ["x86_64-unknown-linux-gnu"]

[dependencies]
async-trait = "0.1.57"
scale-info = { version = "2.1.1", features = ["derive"] }
codec = { package = "parity-scale-codec", version = "3.2.2", features = ["derive"] }
futures = "0.3.21"
log = "0.4.17"
Expand Down
2 changes: 1 addition & 1 deletion client/consensus/babe/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ mod tests;
const LOG_TARGET: &str = "babe";

/// BABE epoch information
#[derive(Decode, Encode, PartialEq, Eq, Clone, Debug)]
#[derive(Decode, Encode, PartialEq, Eq, Clone, Debug, scale_info::TypeInfo)]
pub struct Epoch {
/// The epoch index.
pub epoch_index: u64,
Expand Down
13 changes: 7 additions & 6 deletions frame/benchmarking/src/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ use frame_support::{
pallet_prelude::*,
traits::StorageInfo,
};
use scale_info::TypeInfo;
#[cfg(feature = "std")]
use serde::{Deserialize, Serialize};
use sp_io::hashing::blake2_256;
Expand All @@ -31,7 +32,7 @@ use sp_storage::TrackedStorageKey;

/// An alphabet of possible parameters to use for benchmarking.
#[cfg_attr(feature = "std", derive(Serialize, Deserialize))]
#[derive(Encode, Decode, Clone, Copy, PartialEq, Debug)]
#[derive(Encode, Decode, Clone, Copy, PartialEq, Debug, TypeInfo)]
#[allow(missing_docs)]
#[allow(non_camel_case_types)]
pub enum BenchmarkParameter {
Expand Down Expand Up @@ -72,7 +73,7 @@ impl std::fmt::Display for BenchmarkParameter {

/// The results of a single of benchmark.
#[cfg_attr(feature = "std", derive(Serialize, Deserialize))]
#[derive(Encode, Decode, Clone, PartialEq, Debug)]
#[derive(Encode, Decode, Clone, PartialEq, Debug, TypeInfo)]
pub struct BenchmarkBatch {
/// The pallet containing this benchmark.
#[cfg_attr(feature = "std", serde(with = "serde_as_str"))]
Expand Down Expand Up @@ -111,7 +112,7 @@ pub struct BenchmarkBatchSplitResults {
/// Contains duration of the function call in nanoseconds along with the benchmark parameters
/// used for that benchmark result.
#[cfg_attr(feature = "std", derive(Serialize, Deserialize))]
#[derive(Encode, Decode, Default, Clone, PartialEq, Debug)]
#[derive(Encode, Decode, Default, Clone, PartialEq, Debug, TypeInfo)]
pub struct BenchmarkResult {
pub components: Vec<(BenchmarkParameter, u32)>,
pub extrinsic_time: u128,
Expand Down Expand Up @@ -199,7 +200,7 @@ impl From<DispatchError> for BenchmarkError {
}

/// Configuration used to setup and run runtime benchmarks.
#[derive(Encode, Decode, Default, Clone, PartialEq, Debug)]
#[derive(Encode, Decode, Default, Clone, PartialEq, Debug, TypeInfo)]
pub struct BenchmarkConfig {
/// The encoded name of the pallet to benchmark.
pub pallet: Vec<u8>,
Expand All @@ -216,14 +217,14 @@ pub struct BenchmarkConfig {
/// A list of benchmarks available for a particular pallet and instance.
///
/// All `Vec<u8>` must be valid utf8 strings.
#[derive(Encode, Decode, Default, Clone, PartialEq, Debug)]
#[derive(Encode, Decode, Default, Clone, PartialEq, Debug, TypeInfo)]
pub struct BenchmarkList {
pub pallet: Vec<u8>,
pub instance: Vec<u8>,
pub benchmarks: Vec<BenchmarkMetadata>,
}

#[derive(Encode, Decode, Default, Clone, PartialEq, Debug)]
#[derive(Encode, Decode, Default, Clone, PartialEq, Debug, TypeInfo)]
pub struct BenchmarkMetadata {
pub name: Vec<u8>,
pub components: Vec<(BenchmarkParameter, u32, u32)>,
Expand Down
2 changes: 2 additions & 0 deletions frame/contracts/primitives/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ targets = ["x86_64-unknown-linux-gnu"]

[dependencies]
bitflags = "1.0"
scale-info = { version = "2.1.1", default-features = false, features = ["derive"] }
codec = { package = "parity-scale-codec", version = "3.2.2", default-features = false, features = ["derive"] }

# Substrate Dependencies (This crate should not rely on frame)
Expand All @@ -27,4 +28,5 @@ std = [
"codec/std",
"sp-runtime/std",
"sp-std/std",
"scale-info/std",
]
17 changes: 9 additions & 8 deletions frame/contracts/primitives/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@

use bitflags::bitflags;
use codec::{Decode, Encode};
use scale_info::TypeInfo;
use sp_runtime::{
traits::{Saturating, Zero},
DispatchError, RuntimeDebug,
Expand All @@ -31,7 +32,7 @@ use sp_weights::Weight;
/// Result type of a `bare_call` or `bare_instantiate` call.
///
/// It contains the execution result together with some auxiliary information.
#[derive(Eq, PartialEq, Encode, Decode, RuntimeDebug)]
#[derive(Eq, PartialEq, Encode, Decode, RuntimeDebug, TypeInfo)]
pub struct ContractResult<R, Balance> {
/// How much weight was consumed during execution.
pub gas_consumed: Weight,
Expand Down Expand Up @@ -86,7 +87,7 @@ pub type CodeUploadResult<CodeHash, Balance> =
pub type GetStorageResult = Result<Option<Vec<u8>>, ContractAccessError>;

/// The possible errors that can happen querying the storage of a contract.
#[derive(Eq, PartialEq, Encode, Decode, RuntimeDebug)]
#[derive(Eq, PartialEq, Encode, Decode, RuntimeDebug, TypeInfo)]
pub enum ContractAccessError {
/// The given address doesn't point to a contract.
DoesntExist,
Expand All @@ -96,15 +97,15 @@ pub enum ContractAccessError {

bitflags! {
/// Flags used by a contract to customize exit behaviour.
#[derive(Encode, Decode)]
#[derive(Encode, Decode, TypeInfo)]
pub struct ReturnFlags: u32 {
/// If this bit is set all changes made by the contract execution are rolled back.
const REVERT = 0x0000_0001;
}
}

/// Output of a contract call or instantiation which ran to completion.
#[derive(PartialEq, Eq, Encode, Decode, RuntimeDebug)]
#[derive(PartialEq, Eq, Encode, Decode, RuntimeDebug, TypeInfo)]
pub struct ExecReturnValue {
/// Flags passed along by `seal_return`. Empty when `seal_return` was never called.
pub flags: ReturnFlags,
Expand All @@ -120,7 +121,7 @@ impl ExecReturnValue {
}

/// The result of a successful contract instantiation.
#[derive(PartialEq, Eq, Encode, Decode, RuntimeDebug)]
#[derive(PartialEq, Eq, Encode, Decode, RuntimeDebug, TypeInfo)]
pub struct InstantiateReturnValue<AccountId> {
/// The output of the called constructor.
pub result: ExecReturnValue,
Expand All @@ -129,7 +130,7 @@ pub struct InstantiateReturnValue<AccountId> {
}

/// The result of succesfully uploading a contract.
#[derive(PartialEq, Eq, Encode, Decode, RuntimeDebug)]
#[derive(PartialEq, Eq, Encode, Decode, RuntimeDebug, TypeInfo)]
pub struct CodeUploadReturnValue<CodeHash, Balance> {
/// The key under which the new code is stored.
pub code_hash: CodeHash,
Expand All @@ -138,7 +139,7 @@ pub struct CodeUploadReturnValue<CodeHash, Balance> {
}

/// Reference to an existing code hash or a new wasm module.
#[derive(Eq, PartialEq, Encode, Decode, RuntimeDebug)]
#[derive(Eq, PartialEq, Encode, Decode, RuntimeDebug, TypeInfo)]
pub enum Code<Hash> {
/// A wasm module as raw bytes.
Upload(Vec<u8>),
Expand All @@ -153,7 +154,7 @@ impl<T: Into<Vec<u8>>, Hash> From<T> for Code<Hash> {
}

/// The amount of balance that was either charged or refunded in order to pay for storage.
#[derive(Eq, PartialEq, Ord, PartialOrd, Encode, Decode, RuntimeDebug, Clone)]
#[derive(Eq, PartialEq, Ord, PartialOrd, Encode, Decode, RuntimeDebug, Clone, TypeInfo)]
pub enum StorageDeposit<Balance> {
/// The transaction reduced storage consumption.
///
Expand Down
4 changes: 3 additions & 1 deletion frame/support/src/traits/storage.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,9 @@ pub trait StorageInstance {
}

/// Metadata about storage from the runtime.
#[derive(codec::Encode, codec::Decode, crate::RuntimeDebug, Eq, PartialEq, Clone)]
#[derive(
codec::Encode, codec::Decode, crate::RuntimeDebug, Eq, PartialEq, Clone, scale_info::TypeInfo,
)]
pub struct StorageInfo {
/// Encoded string of pallet name.
pub pallet_name: Vec<u8>,
Expand Down
4 changes: 2 additions & 2 deletions frame/support/src/traits/try_runtime.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ use sp_arithmetic::traits::AtLeast32BitUnsigned;
use sp_std::prelude::*;

/// Which state tests to execute.
#[derive(codec::Encode, codec::Decode, Clone)]
#[derive(codec::Encode, codec::Decode, Clone, scale_info::TypeInfo)]
pub enum Select {
/// None of them.
None,
Expand Down Expand Up @@ -82,7 +82,7 @@ impl sp_std::str::FromStr for Select {
}

/// Select which checks should be run when trying a runtime upgrade upgrade.
#[derive(codec::Encode, codec::Decode, Clone, Debug, Copy)]
#[derive(codec::Encode, codec::Decode, Clone, Debug, Copy, scale_info::TypeInfo)]
pub enum UpgradeCheckSelect {
/// Run no checks.
None,
Expand Down
8 changes: 5 additions & 3 deletions frame/transaction-payment/src/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,15 @@ use codec::{Decode, Encode};
#[cfg(feature = "std")]
use serde::{Deserialize, Serialize};

use scale_info::TypeInfo;

use sp_runtime::traits::{AtLeast32BitUnsigned, Zero};
use sp_std::prelude::*;

use frame_support::dispatch::DispatchClass;

/// The base fee and adjusted weight and length fees constitute the _inclusion fee_.
#[derive(Encode, Decode, Clone, Eq, PartialEq)]
#[derive(Encode, Decode, Clone, Eq, PartialEq, TypeInfo)]
#[cfg_attr(feature = "std", derive(Debug, Serialize, Deserialize))]
#[cfg_attr(feature = "std", serde(rename_all = "camelCase"))]
pub struct InclusionFee<Balance> {
Expand Down Expand Up @@ -63,7 +65,7 @@ impl<Balance: AtLeast32BitUnsigned + Copy> InclusionFee<Balance> {
/// - (Optional) `inclusion_fee`: Only the `Pays::Yes` transaction can have the inclusion fee.
/// - `tip`: If included in the transaction, the tip will be added on top. Only signed
/// transactions can have a tip.
#[derive(Encode, Decode, Clone, Eq, PartialEq)]
#[derive(Encode, Decode, Clone, Eq, PartialEq, TypeInfo)]
#[cfg_attr(feature = "std", derive(Debug, Serialize, Deserialize))]
#[cfg_attr(feature = "std", serde(rename_all = "camelCase"))]
pub struct FeeDetails<Balance> {
Expand Down Expand Up @@ -91,7 +93,7 @@ impl<Balance: AtLeast32BitUnsigned + Copy> FeeDetails<Balance> {

/// Information related to a dispatchable's class, weight, and fee that can be queried from the
/// runtime.
#[derive(Eq, PartialEq, Encode, Decode, Default)]
#[derive(Eq, PartialEq, Encode, Decode, Default, TypeInfo)]
#[cfg_attr(feature = "std", derive(Debug, Serialize, Deserialize))]
#[cfg_attr(feature = "std", serde(rename_all = "camelCase"))]
#[cfg_attr(
Expand Down
6 changes: 3 additions & 3 deletions primitives/consensus/babe/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ impl From<BabeConfigurationV1> for BabeConfiguration {
}

/// Configuration data used by the BABE consensus engine.
#[derive(Clone, PartialEq, Eq, Encode, Decode, RuntimeDebug)]
#[derive(Clone, PartialEq, Eq, Encode, Decode, RuntimeDebug, TypeInfo)]
pub struct BabeConfiguration {
/// The slot duration in milliseconds for BABE. Currently, only
/// the value provided by this type at genesis will be used.
Expand Down Expand Up @@ -327,7 +327,7 @@ where
/// the runtime API boundary this type is unknown and as such we keep this
/// opaque representation, implementors of the runtime API will have to make
/// sure that all usages of `OpaqueKeyOwnershipProof` refer to the same type.
#[derive(Decode, Encode, PartialEq)]
#[derive(Decode, Encode, PartialEq, TypeInfo)]
pub struct OpaqueKeyOwnershipProof(Vec<u8>);
impl OpaqueKeyOwnershipProof {
/// Create a new `OpaqueKeyOwnershipProof` using the given encoded
Expand All @@ -344,7 +344,7 @@ impl OpaqueKeyOwnershipProof {
}

/// BABE epoch information
#[derive(Decode, Encode, PartialEq, Eq, Clone, Debug)]
#[derive(Decode, Encode, PartialEq, Eq, Clone, Debug, TypeInfo)]
pub struct Epoch {
/// The epoch index.
pub epoch_index: u64,
Expand Down
2 changes: 1 addition & 1 deletion primitives/core/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ impl sp_std::str::FromStr for Bytes {
}

/// Stores the encoded `RuntimeMetadata` for the native side as opaque type.
#[derive(Encode, Decode, PartialEq)]
#[derive(Encode, Decode, PartialEq, TypeInfo)]
pub struct OpaqueMetadata(Vec<u8>);

impl OpaqueMetadata {
Expand Down
2 changes: 1 addition & 1 deletion primitives/finality-grandpa/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -529,7 +529,7 @@ impl<'a> Decode for VersionedAuthorityList<'a> {
/// the runtime API boundary this type is unknown and as such we keep this
/// opaque representation, implementors of the runtime API will have to make
/// sure that all usages of `OpaqueKeyOwnershipProof` refer to the same type.
#[derive(Decode, Encode, PartialEq)]
#[derive(Decode, Encode, PartialEq, TypeInfo)]
pub struct OpaqueKeyOwnershipProof(Vec<u8>);

impl OpaqueKeyOwnershipProof {
Expand Down
2 changes: 2 additions & 0 deletions primitives/inherents/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ targets = ["x86_64-unknown-linux-gnu"]
[dependencies]
async-trait = { version = "0.1.57", optional = true }
codec = { package = "parity-scale-codec", version = "3.2.2", default-features = false, features = ["derive"] }
scale-info = { version = "2.1.1", default-features = false, features = ["derive"] }
impl-trait-for-tuples = "0.2.2"
thiserror = { version = "1.0.30", optional = true }
sp-core = { version = "7.0.0", default-features = false, path = "../core" }
Expand All @@ -30,6 +31,7 @@ default = [ "std" ]
std = [
"async-trait",
"codec/std",
"scale-info/std",
"sp-core/std",
"sp-runtime/std",
"sp-std/std",
Expand Down
4 changes: 2 additions & 2 deletions primitives/inherents/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ pub enum Error {
pub type InherentIdentifier = [u8; 8];

/// Inherent data to include in a block.
#[derive(Clone, Default, Encode, Decode)]
#[derive(Clone, Default, Encode, Decode, scale_info::TypeInfo)]
pub struct InherentData {
/// All inherent data encoded with parity-scale-codec and an identifier.
data: BTreeMap<InherentIdentifier, Vec<u8>>,
Expand Down Expand Up @@ -276,7 +276,7 @@ impl InherentData {
///
/// When a fatal error occurs, all other errors are removed and the implementation needs to
/// abort checking inherents.
#[derive(Encode, Decode, Clone)]
#[derive(Encode, Decode, Clone, scale_info::TypeInfo)]
pub struct CheckInherentsResult {
/// Did the check succeed?
okay: bool,
Expand Down
4 changes: 2 additions & 2 deletions primitives/merkle-mountain-range/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ impl FullLeaf for OpaqueLeaf {
///
/// It is different from [`OpaqueLeaf`], because it does implement `Codec`
/// and the encoding has to match raw `Vec<u8>` encoding.
#[derive(codec::Encode, codec::Decode, RuntimeDebug, PartialEq, Eq)]
#[derive(codec::Encode, codec::Decode, RuntimeDebug, PartialEq, Eq, TypeInfo)]
pub struct EncodableOpaqueLeaf(pub Vec<u8>);

impl EncodableOpaqueLeaf {
Expand Down Expand Up @@ -361,7 +361,7 @@ pub struct Proof<Hash> {

/// Merkle Mountain Range operation error.
#[cfg_attr(feature = "std", derive(thiserror::Error))]
#[derive(RuntimeDebug, codec::Encode, codec::Decode, PartialEq, Eq)]
#[derive(RuntimeDebug, codec::Encode, codec::Decode, PartialEq, Eq, TypeInfo)]
pub enum Error {
/// Error during translation of a block number into a leaf index.
#[cfg_attr(feature = "std", error("Error performing numeric op"))]
Expand Down
2 changes: 1 addition & 1 deletion primitives/runtime/src/generic/block.rs
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ impl<Block: BlockT> fmt::Display for BlockId<Block> {
}

/// Abstraction over a substrate block.
#[derive(PartialEq, Eq, Clone, Encode, Decode, RuntimeDebug)]
#[derive(PartialEq, Eq, Clone, Encode, Decode, RuntimeDebug, scale_info::TypeInfo)]
#[cfg_attr(feature = "std", derive(Serialize, Deserialize))]
#[cfg_attr(feature = "std", serde(rename_all = "camelCase"))]
#[cfg_attr(feature = "std", serde(deny_unknown_fields))]
Expand Down
4 changes: 2 additions & 2 deletions primitives/runtime/src/transaction_validity.rs
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ impl From<UnknownTransaction> for TransactionValidity {
/// Depending on the source we might apply different validation schemes.
/// For instance we can disallow specific kinds of transactions if they were not produced
/// by our local node (for instance off-chain workers).
#[derive(Copy, Clone, PartialEq, Eq, Encode, Decode, RuntimeDebug)]
#[derive(Copy, Clone, PartialEq, Eq, Encode, Decode, RuntimeDebug, TypeInfo)]
pub enum TransactionSource {
/// Transaction is already included in block.
///
Expand All @@ -251,7 +251,7 @@ pub enum TransactionSource {
}

/// Information concerning a valid transaction.
#[derive(Clone, PartialEq, Eq, Encode, Decode, RuntimeDebug)]
#[derive(Clone, PartialEq, Eq, Encode, Decode, RuntimeDebug, TypeInfo)]
pub struct ValidTransaction {
/// Priority of the transaction.
///
Expand Down
2 changes: 1 addition & 1 deletion test-utils/runtime/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ pub fn run_tests(mut input: &[u8]) -> Vec<u8> {
}

/// A type that can not be decoded.
#[derive(PartialEq)]
#[derive(PartialEq, TypeInfo)]
pub struct DecodeFails<B: BlockT> {
_phantom: PhantomData<B>,
}
Expand Down