Skip to content

Commit

Permalink
Update to Substrate release candidate (#116)
Browse files Browse the repository at this point in the history
* Substrate rc1

* Add tx version extra

* Remove CheckBlockGasLimit

* Substrate rc2
  • Loading branch information
ascjones authored May 26, 2020
1 parent 4dadb2c commit 0d58f4b
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 35 deletions.
24 changes: 12 additions & 12 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,22 +27,22 @@ serde_json = "1.0"
url = "2.1"
codec = { package = "parity-scale-codec", version = "1.3", default-features = false, features = ["derive", "full"] }

frame-metadata = { version = "11.0.0-alpha.8", package = "frame-metadata" }
frame-support = { version = "2.0.0-alpha.8", package = "frame-support" }
sp-runtime = { version = "2.0.0-alpha.8", package = "sp-runtime" }
sp-version = { version = "2.0.0-alpha.8", package = "sp-version" }
pallet-indices = { version = "2.0.0-alpha.8", package = "pallet-indices" }
frame-metadata = { version = "11.0.0-rc2", package = "frame-metadata" }
frame-support = { version = "2.0.0-rc2", package = "frame-support" }
sp-runtime = { version = "2.0.0-rc2", package = "sp-runtime" }
sp-version = { version = "2.0.0-rc2", package = "sp-version" }
pallet-indices = { version = "2.0.0-rc2", package = "pallet-indices" }
hex = "0.4.0"
sp-rpc = { version = "2.0.0-alpha.8", package = "sp-rpc" }
sp-core = { version = "2.0.0-alpha.8", package = "sp-core" }
sc-rpc-api = { version = "0.8.0-alpha.8", package = "sc-rpc-api" }
sp-transaction-pool = { version = "2.0.0-alpha.8", package = "sp-transaction-pool" }
sp-rpc = { version = "2.0.0-rc2", package = "sp-rpc" }
sp-core = { version = "2.0.0-rc2", package = "sp-core" }
sc-rpc-api = { version = "0.8.0-rc2", package = "sc-rpc-api" }
sp-transaction-pool = { version = "2.0.0-rc2", package = "sp-transaction-pool" }
substrate-subxt-proc-macro = { version = "0.7.0", path = "proc-macro" }

[dev-dependencies]
async-std = { version = "1.5.0", features = ["attributes"] }
env_logger = "0.7"
wabt = "0.9"
frame-system = { version = "2.0.0-alpha.8", package = "frame-system" }
pallet-balances = { version = "2.0.0-alpha.8", package = "pallet-balances" }
sp-keyring = { version = "2.0.0-alpha.8", package = "sp-keyring" }
frame-system = { version = "2.0.0-rc2", package = "frame-system" }
pallet-balances = { version = "2.0.0-rc2", package = "pallet-balances" }
sp-keyring = { version = "2.0.0-rc2", package = "sp-keyring" }
2 changes: 1 addition & 1 deletion proc-macro/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ async-std = { version = "1.5.0", features = ["attributes"] }
codec = { package = "parity-scale-codec", version = "1.3.0", features = ["derive"] }
env_logger = "0.7.1"
pretty_assertions = "0.6.1"
sp-keyring = "2.0.0-alpha.8"
sp-keyring = "2.0.0-rc2"
substrate-subxt = { path = ".." }
trybuild = "1.0.25"

Expand Down
24 changes: 2 additions & 22 deletions src/extra.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ use crate::frame::{
///
/// This is modified from the substrate version to allow passing in of the version, which is
/// returned via `additional_signed()`.
/// Ensure the runtime version registered in the transaction is the same as at present.
#[derive(Encode, Decode, Clone, Eq, PartialEq, Debug)]
pub struct CheckSpecVersion<T: System>(
pub PhantomData<T>,
Expand Down Expand Up @@ -219,26 +221,6 @@ where
}
}

/// Checks if a transaction would exhausts the block gas limit.
#[derive(Encode, Decode, Clone, Eq, PartialEq, Debug)]
pub struct CheckBlockGasLimit<T: System>(pub PhantomData<T>);

impl<T> SignedExtension for CheckBlockGasLimit<T>
where
T: System + Clone + Debug + Eq + Send + Sync,
{
const IDENTIFIER: &'static str = "CheckBlockGasLimit";
type AccountId = u64;
type Call = ();
type AdditionalSigned = ();
type Pre = ();
fn additional_signed(
&self,
) -> Result<Self::AdditionalSigned, TransactionValidityError> {
Ok(())
}
}

/// Trait for implementing transaction extras for a runtime.
pub trait SignedExtra<T: System> {
/// The type the extras.
Expand Down Expand Up @@ -276,7 +258,6 @@ impl<T: System + Balances + Clone + Debug + Eq + Send + Sync> SignedExtra<T>
CheckNonce<T>,
CheckWeight<T>,
ChargeTransactionPayment<T>,
CheckBlockGasLimit<T>,
);

fn new(
Expand All @@ -302,7 +283,6 @@ impl<T: System + Balances + Clone + Debug + Eq + Send + Sync> SignedExtra<T>
CheckNonce(self.nonce),
CheckWeight(PhantomData),
ChargeTransactionPayment(<T as Balances>::Balance::default()),
CheckBlockGasLimit(PhantomData),
)
}
}
Expand Down

0 comments on commit 0d58f4b

Please sign in to comment.