Skip to content
This repository was archived by the owner on Nov 15, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
b042a93
Make extrinsics extensible.
gavofyork Jul 11, 2019
37f6ae0
Rest of mockup. Add tips.
gavofyork Jul 11, 2019
2e5b1f4
Fix some build issues
gavofyork Jul 11, 2019
b7646ec
Runtiem builds :)
gavofyork Jul 11, 2019
a871c9f
Substrate builds.
kianenigma Jul 12, 2019
8e7c803
Fix a doc test
gavofyork Jul 13, 2019
a824b56
Compact encoding
gavofyork Jul 13, 2019
5de080f
Extract out the era logic into an extension
gavofyork Jul 15, 2019
a8789b9
Weight Check signed extension. (#3115)
kianenigma Jul 16, 2019
7d96429
Merge remote-tracking branch 'origin/master' into gav-extensble-trans…
gavofyork Jul 16, 2019
30b4ba7
Don't use len for weight - use data.
gavofyork Jul 16, 2019
2a9c9df
Merge remote-tracking branch 'origin/master' into gav-extensble-trans…
gavofyork Jul 19, 2019
342efb5
Operational Transaction; second attempt (#3138)
kianenigma Jul 19, 2019
b8f564e
Bump transaction version
jacogr Jul 19, 2019
07fdfe2
Merge branch 'gav-extensble-transactions' of github.com:paritytech/su…
jacogr Jul 19, 2019
7f33006
Master.into()
kianenigma Jul 19, 2019
36063fe
Merge branch 'gav-extensble-transactions' of github.com:paritytech/su…
kianenigma Jul 19, 2019
7a0fbc9
Fix weight mult test.
kianenigma Jul 19, 2019
84fa279
Fix more tests and improve doc.
kianenigma Jul 19, 2019
f4d4579
Bump.
kianenigma Jul 19, 2019
def6425
Merge remote-tracking branch 'origin/master' into gav-extensble-trans…
gavofyork Jul 20, 2019
d12713a
Make some tests work again.
kianenigma Jul 20, 2019
3350f9c
Fix subkey.
kianenigma Jul 20, 2019
b788507
Remove todos + bump.
kianenigma Jul 20, 2019
b9b6b53
First draft of annotating weights.
kianenigma Jul 21, 2019
045681e
Refactor weight to u64.
kianenigma Jul 22, 2019
bfcfa36
More refactoring and tests.
kianenigma Jul 23, 2019
107801f
One hell of a merge conflict.
kianenigma Jul 23, 2019
c100df9
New convert for weight to fee
kianenigma Jul 23, 2019
f5d33c6
more tests.
kianenigma Jul 23, 2019
0c1c268
remove merge redundancy.
kianenigma Jul 23, 2019
6a0a1d4
Fix system test.
kianenigma Jul 24, 2019
b06ef82
Master.into()
kianenigma Jul 24, 2019
c3e0ee3
Bring back subkey stuff.
kianenigma Jul 24, 2019
5b0c715
a few stress tests.
kianenigma Jul 24, 2019
e683829
fix some of the grumbles.
kianenigma Jul 24, 2019
ce11fc5
Merge branch 'master' of github.com:paritytech/substrate into kiz-ann…
kianenigma Jul 24, 2019
0b592e2
Final nits.
kianenigma Jul 24, 2019
ee970d1
Merge branch 'master' into kiz-annotate-weights
Demi-Marie Jul 24, 2019
58191a3
Update srml/system/src/lib.rs
kianenigma Jul 24, 2019
67b268a
Master.into()
kianenigma Jul 25, 2019
0d9133f
Merge conflicts.
kianenigma Jul 25, 2019
ec6554f
Scale weights by 1000.
kianenigma Jul 25, 2019
a25e4be
Bump.
kianenigma Jul 25, 2019
5724771
Fix decl_storage test.
kianenigma Jul 25, 2019
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
Runtiem builds :)
  • Loading branch information
gavofyork committed Jul 11, 2019
commit b7646ec9b0a0c3f40ef2d35391b31f0ce57c30e4
8 changes: 5 additions & 3 deletions node/runtime/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -435,12 +435,14 @@ pub type Block = generic::Block<Header, UncheckedExtrinsic>;
pub type SignedBlock = generic::SignedBlock<Block>;
/// BlockId type as expected by this runtime.
pub type BlockId = generic::BlockId<Block>;
/// The SignedExtension to the basic transaction logic.
type SignedExtra = (system::CheckNonce<Runtime>, balances::TakeFees<Runtime>);
/// Unchecked extrinsic type as expected by this runtime.
pub type UncheckedExtrinsic = generic::UncheckedExtrinsic<Address, Index, Call, Signature>;
pub type UncheckedExtrinsic = generic::UncheckedExtrinsic<Address, Call, Signature, SignedExtra>;
/// Extrinsic type that has already been checked.
pub type CheckedExtrinsic = generic::CheckedExtrinsic<AccountId, Index, Call>;
pub type CheckedExtrinsic = generic::CheckedExtrinsic<AccountId, Call, SignedExtra>;
/// Executive: handles dispatch to the various modules.
pub type Executive = executive::Executive<Runtime, Block, system::ChainContext<Runtime>, Balances, Runtime, AllModules>;
pub type Executive = executive::Executive<Runtime, Block, system::ChainContext<Runtime>, Runtime, AllModules>;

impl_runtime_apis! {
impl client_api::Core<Block> for Runtime {
Expand Down
4 changes: 1 addition & 3 deletions srml/balances/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1133,7 +1133,7 @@ where
/// Require the transactor pay for themselves and maybe include a tip to gain additional priority
/// in the queue.
#[derive(Encode, Decode, Clone, Eq, PartialEq)]
pub struct TakeFees<T: Trait<I>, I: Instance>(T::Balance);
pub struct TakeFees<T: Trait<I>, I: Instance = DefaultInstance>(T::Balance);

#[cfg(feature = "std")]
impl<T: Trait<I>, I: Instance> rstd::fmt::Debug for TakeFees<T, I> {
Expand All @@ -1142,8 +1142,6 @@ impl<T: Trait<I>, I: Instance> rstd::fmt::Debug for TakeFees<T, I> {
}
}

// TODO: wire this and CheckNonce in to the runtime.

use primitives::traits::{DispatchError, SaturatedConversion};
use primitives::transaction_validity::ValidTransaction;
use primitives::weights::Weight;
Expand Down
16 changes: 7 additions & 9 deletions srml/executive/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ use primitives::{generic::Digest, traits::{
self, Header, Zero, One, Checkable, Applyable, CheckEqual, OnFinalize,
OnInitialize, NumberFor, Block as BlockT, OffchainWorker, ValidateUnsigned
}};
use srml_support::{Dispatchable, traits::MakePayment};
use srml_support::Dispatchable;
use parity_codec::{Codec, Encode};
use system::{extrinsics_root, DigestOf};
use primitives::{ApplyOutcome, ApplyError};
Expand Down Expand Up @@ -130,18 +130,17 @@ pub type CheckedOf<E, C> = <E as Checkable<C>>::Checked;
pub type CallOf<E, C> = <CheckedOf<E, C> as Applyable>::Call;
pub type OriginOf<E, C> = <CallOf<E, C> as Dispatchable>::Origin;

pub struct Executive<System, Block, Context, Payment, UnsignedValidator, AllModules>(
PhantomData<(System, Block, Context, Payment, UnsignedValidator, AllModules)>
pub struct Executive<System, Block, Context, UnsignedValidator, AllModules>(
PhantomData<(System, Block, Context, UnsignedValidator, AllModules)>
);

impl<
System: system::Trait,
Block: traits::Block<Header=System::Header, Hash=System::Hash>,
Context: Default,
Payment: MakePayment<System::AccountId>,
UnsignedValidator,
AllModules: OnInitialize<System::BlockNumber> + OnFinalize<System::BlockNumber> + OffchainWorker<System::BlockNumber>,
> ExecuteBlock<Block> for Executive<System, Block, Context, Payment, UnsignedValidator, AllModules>
> ExecuteBlock<Block> for Executive<System, Block, Context, UnsignedValidator, AllModules>
where
Block::Extrinsic: Checkable<Context> + Codec,
CheckedOf<Block::Extrinsic, Context>: Applyable<AccountId=System::AccountId> + Weighable,
Expand All @@ -150,18 +149,17 @@ where
UnsignedValidator: ValidateUnsigned<Call=CallOf<Block::Extrinsic, Context>>,
{
fn execute_block(block: Block) {
Executive::<System, Block, Context, Payment, UnsignedValidator, AllModules>::execute_block(block);
Executive::<System, Block, Context, UnsignedValidator, AllModules>::execute_block(block);
}
}

impl<
System: system::Trait,
Block: traits::Block<Header=System::Header, Hash=System::Hash>,
Context: Default,
Payment: MakePayment<System::AccountId>,
UnsignedValidator,
AllModules: OnInitialize<System::BlockNumber> + OnFinalize<System::BlockNumber> + OffchainWorker<System::BlockNumber>,
> Executive<System, Block, Context, Payment, UnsignedValidator, AllModules>
> Executive<System, Block, Context, UnsignedValidator, AllModules>
where
Block::Extrinsic: Checkable<Context> + Codec,
CheckedOf<Block::Extrinsic, Context>: Applyable<AccountId=System::AccountId> + Weighable,
Expand Down Expand Up @@ -351,7 +349,7 @@ where
Err(_) => return TransactionValidity::Invalid(UNKNOWN_ERROR),
};

let weight = xt.weight(encoded_len);
let weight = xt.weight(encoded_len);

xt.validate::<UnsignedValidator>(weight)
}
Expand Down