mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-12 08:51:09 +00:00
Introduce safe types for handling imbalances (#2048)
* Be a little safer with total issuance. * PairT instead of _Pair * Remove rev causing upset * Remove fees stuff. * Fix build (including tests) * Update runtime, bump version * Fix * Handle gas refunds properly. * Rename identifier ala #2025 * Address grumbles * New not-quite-linear-typing API * Slimmer API * More linear-type test fixes * Fix tests * Tidy * Fix some grumbles * Keep unchecked functions private * Remove another less-than-safe currency function and ensure that contracts module can never create cash. * Address a few grumbles and fix tests
This commit is contained in:
committed by
Robert Habermeier
parent
f9e224e7b8
commit
dcd77a147c
@@ -30,7 +30,6 @@ system = { package = "srml-system", path = "../../srml/system", default-features
|
||||
timestamp = { package = "srml-timestamp", path = "../../srml/timestamp", default-features = false }
|
||||
treasury = { package = "srml-treasury", path = "../../srml/treasury", default-features = false }
|
||||
sudo = { package = "srml-sudo", path = "../../srml/sudo", default-features = false }
|
||||
fees = { package = "srml-fees", path = "../../srml/fees", default-features = false }
|
||||
node-primitives = { path = "../primitives", default-features = false }
|
||||
consensus_aura = { package = "substrate-consensus-aura-primitives", path = "../../core/consensus/aura/primitives", default-features = false }
|
||||
rustc-hex = { version = "2.0", optional = true }
|
||||
@@ -60,7 +59,6 @@ std = [
|
||||
"timestamp/std",
|
||||
"treasury/std",
|
||||
"sudo/std",
|
||||
"fees/std",
|
||||
"version/std",
|
||||
"node-primitives/std",
|
||||
"serde",
|
||||
|
||||
@@ -58,8 +58,8 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
|
||||
spec_name: create_runtime_str!("node"),
|
||||
impl_name: create_runtime_str!("substrate-node"),
|
||||
authoring_version: 10,
|
||||
spec_version: 37,
|
||||
impl_version: 41,
|
||||
spec_version: 38,
|
||||
impl_version: 38,
|
||||
apis: RUNTIME_API_VERSIONS,
|
||||
};
|
||||
|
||||
@@ -102,11 +102,9 @@ impl balances::Trait for Runtime {
|
||||
type OnFreeBalanceZero = ((Staking, Contract), Session);
|
||||
type OnNewAccount = Indices;
|
||||
type Event = Event;
|
||||
}
|
||||
|
||||
impl fees::Trait for Runtime {
|
||||
type Event = Event;
|
||||
type TransferAsset = Balances;
|
||||
type TransactionPayment = ();
|
||||
type DustRemoval = ();
|
||||
type TransferPayment = ();
|
||||
}
|
||||
|
||||
impl consensus::Trait for Runtime {
|
||||
@@ -133,6 +131,8 @@ impl staking::Trait for Runtime {
|
||||
type Currency = balances::Module<Self>;
|
||||
type OnRewardMinted = Treasury;
|
||||
type Event = Event;
|
||||
type Slash = ();
|
||||
type Reward = ();
|
||||
}
|
||||
|
||||
impl democracy::Trait for Runtime {
|
||||
@@ -143,6 +143,8 @@ impl democracy::Trait for Runtime {
|
||||
|
||||
impl council::Trait for Runtime {
|
||||
type Event = Event;
|
||||
type BadPresentation = ();
|
||||
type BadReaper = ();
|
||||
}
|
||||
|
||||
impl council::voting::Trait for Runtime {
|
||||
@@ -160,6 +162,8 @@ impl treasury::Trait for Runtime {
|
||||
type ApproveOrigin = council_motions::EnsureMembers<_4>;
|
||||
type RejectOrigin = council_motions::EnsureMembers<_2>;
|
||||
type Event = Event;
|
||||
type MintedForSpending = ();
|
||||
type ProposalRejection = ();
|
||||
}
|
||||
|
||||
impl contract::Trait for Runtime {
|
||||
@@ -168,6 +172,7 @@ impl contract::Trait for Runtime {
|
||||
type Gas = u64;
|
||||
type DetermineContractAddress = contract::SimpleAddressDeterminator<Runtime>;
|
||||
type ComputeDispatchFee = contract::DefaultDispatchFeeComputor<Runtime>;
|
||||
type GasPayment = ();
|
||||
}
|
||||
|
||||
impl sudo::Trait for Runtime {
|
||||
@@ -209,7 +214,6 @@ construct_runtime!(
|
||||
Treasury: treasury,
|
||||
Contract: contract::{Module, Call, Storage, Config<T>, Event<T>},
|
||||
Sudo: sudo,
|
||||
Fees: fees::{Module, Storage, Config<T>, Event<T>},
|
||||
}
|
||||
);
|
||||
|
||||
@@ -228,7 +232,7 @@ pub type UncheckedExtrinsic = generic::UncheckedMortalCompactExtrinsic<Address,
|
||||
/// Extrinsic type that has already been checked.
|
||||
pub type CheckedExtrinsic = generic::CheckedExtrinsic<AccountId, Index, Call>;
|
||||
/// Executive: handles dispatch to the various modules.
|
||||
pub type Executive = executive::Executive<Runtime, Block, system::ChainContext<Runtime>, Fees, AllModules>;
|
||||
pub type Executive = executive::Executive<Runtime, Block, system::ChainContext<Runtime>, Balances, AllModules>;
|
||||
|
||||
impl_runtime_apis! {
|
||||
impl client_api::Core<Block> for Runtime {
|
||||
|
||||
Generated
+19
-19
@@ -801,7 +801,6 @@ dependencies = [
|
||||
"srml-council 0.1.0",
|
||||
"srml-democracy 0.1.0",
|
||||
"srml-executive 0.1.0",
|
||||
"srml-fees 0.1.0",
|
||||
"srml-finality-tracker 0.1.0",
|
||||
"srml-grandpa 0.1.0",
|
||||
"srml-indices 0.1.0",
|
||||
@@ -1295,6 +1294,23 @@ dependencies = [
|
||||
"subtle 2.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "schnorrkel"
|
||||
version = "0.1.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
dependencies = [
|
||||
"clear_on_drop 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"curve25519-dalek 1.1.3 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"ed25519-dalek 1.0.0-pre.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"failure 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"merlin 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"rand 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"rand_chacha 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"sha2 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"sha3 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"subtle 2.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "scopeguard"
|
||||
version = "0.3.3"
|
||||
@@ -1563,7 +1579,6 @@ dependencies = [
|
||||
"sr-sandbox 0.1.0",
|
||||
"sr-std 0.1.0",
|
||||
"srml-balances 0.1.0",
|
||||
"srml-fees 0.1.0",
|
||||
"srml-support 0.1.0",
|
||||
"srml-system 0.1.0",
|
||||
"srml-timestamp 0.1.0",
|
||||
@@ -1616,22 +1631,6 @@ dependencies = [
|
||||
"srml-system 0.1.0",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "srml-fees"
|
||||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"hex-literal 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"parity-codec 3.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"parity-codec-derive 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"serde 1.0.89 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"sr-io 0.1.0",
|
||||
"sr-primitives 0.1.0",
|
||||
"sr-std 0.1.0",
|
||||
"srml-support 0.1.0",
|
||||
"srml-system 0.1.0",
|
||||
"substrate-primitives 0.1.0",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "srml-finality-tracker"
|
||||
version = "0.1.0"
|
||||
@@ -2010,7 +2009,7 @@ dependencies = [
|
||||
"regex 1.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"ring 0.14.6 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"rustc-hex 2.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"schnorrkel 0.0.0 (git+https://github.com/w3f/schnorrkel)",
|
||||
"schnorrkel 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"serde 1.0.89 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"serde_derive 1.0.89 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"sha2 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
@@ -2643,6 +2642,7 @@ dependencies = [
|
||||
"checksum ryu 0.2.7 (registry+https://github.com/rust-lang/crates.io-index)" = "eb9e9b8cde282a9fe6a42dd4681319bfb63f121b8a8ee9439c6f4107e58a46f7"
|
||||
"checksum safe-mix 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "7f7bf422d23a88c16d5090d455f182bc99c60af4df6a345c63428acf5129e347"
|
||||
"checksum schnorrkel 0.0.0 (git+https://github.com/w3f/schnorrkel)" = "<none>"
|
||||
"checksum schnorrkel 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "a700659388785588c75b197cecda0f23c7112a9281ef703e8ffc651061ce014c"
|
||||
"checksum scopeguard 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "94258f53601af11e6a49f722422f6e3425c52b06245a5cf9bc09908b174f5e27"
|
||||
"checksum semver 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "1d7eb9ef2c18661902cc47e535f9bc51b78acd254da71d375c2f6720d9a40403"
|
||||
"checksum semver-parser 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3"
|
||||
|
||||
BIN
Binary file not shown.
Reference in New Issue
Block a user