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
27 commits
Select commit Hold shift + click to select a range
ab34400
Initial draft of tip enum
Jun 19, 2019
d36dc9a
Fix local tests
Jun 19, 2019
a18be8c
Builds.
kianenigma Jun 22, 2019
55d39cf
Fix test build.
kianenigma Jun 22, 2019
a4e2816
Tratify tip.
kianenigma Jun 23, 2019
58ae208
Cleanup of checkedExt.
kianenigma Jun 23, 2019
c7fe8bf
More cleanup.
kianenigma Jun 23, 2019
e47bf96
Master.into()
kianenigma Jun 23, 2019
78dde21
Checked Tip + other fixes.
kianenigma Jun 27, 2019
7326e5a
Line width
kianenigma Jun 27, 2019
a568a9b
Update core/sr-primitives/src/generic/tip.rs
4meta5 Jun 28, 2019
b3f69cb
Fix build.
kianenigma Jun 28, 2019
557f6c5
Merge branch 'master' of github.com:paritytech/substrate into kiz-tx-tip
kianenigma Jun 28, 2019
8e713aa
Bump.
kianenigma Jun 28, 2019
b110af6
Merge branch 'kiz-tx-tip' of github.com:paritytech/substrate into kiz…
kianenigma Jun 28, 2019
23df80d
Some cleanup (+should pass the tests).
kianenigma Jun 30, 2019
83721a4
Fix sync test payload.
kianenigma Jun 30, 2019
bd28f0d
Fix subkey and factory sig
kianenigma Jun 30, 2019
120de20
revert back old unchecked ext type to NOT use tip.
kianenigma Jul 9, 2019
0d1de9d
Make balance associated type of payment.
kianenigma Jul 10, 2019
6836f6b
Optionize tip.
kianenigma Jul 10, 2019
7191a7d
Further cleanup.
kianenigma Jul 10, 2019
0846065
Further cleanup.
kianenigma Jul 10, 2019
12ecfcc
Master.into()
kianenigma Jul 10, 2019
bf99e73
Fix tests.
kianenigma Jul 10, 2019
4824776
remove balance as generic.
kianenigma Jul 10, 2019
fb42e4e
Update doc.
kianenigma Jul 10, 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
Builds.
  • Loading branch information
kianenigma committed Jun 22, 2019
commit a18be8cd010fe7afc71ad0cbce7bc70cab82cec1
3 changes: 1 addition & 2 deletions core/sr-primitives/src/generic/tip.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,7 @@ use crate::codec::{Encode, Decode};
/// stream.
/// If non-existent, the default implementation will be used.s
#[derive(Clone, Eq, PartialEq, Encode, Decode)]
#[cfg(feature = "std")]
#[derive(Debug)]
#[cfg_attr(feature = "std", derive(Debug))]
pub enum Tip<Balance> {
/// This transaction does not include any tips.
None,
Expand Down
4 changes: 2 additions & 2 deletions node-template/runtime/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -205,9 +205,9 @@ pub type Block = generic::Block<Header, UncheckedExtrinsic>;
/// BlockId type as expected by this runtime.
pub type BlockId = generic::BlockId<Block>;
/// Unchecked extrinsic type as expected by this runtime.
pub type UncheckedExtrinsic = generic::UncheckedMortalCompactExtrinsic<Address, Nonce, Call, AccountSignature>;
pub type UncheckedExtrinsic = generic::UncheckedMortalCompactExtrinsic<Address, Nonce, Call, AccountSignature, u128>;
/// Extrinsic type that has already been checked.
pub type CheckedExtrinsic = generic::CheckedExtrinsic<AccountId, Nonce, Call>;
pub type CheckedExtrinsic = generic::CheckedExtrinsic<AccountId, Nonce, Call, u128>;
/// Executive: handles dispatch to the various modules.
pub type Executive = executive::Executive<Runtime, Block, Context, Balances, Runtime, AllModules>;

Expand Down
8 changes: 6 additions & 2 deletions node/cli/src/factory_impl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ use node_runtime::{Call, CheckedExtrinsic, UncheckedExtrinsic, BalancesCall};
use primitives::sr25519;
use primitives::crypto::Pair;
use parity_codec::Encode;
use sr_primitives::generic::Era;
use sr_primitives::generic::{Era, Tip};
use sr_primitives::traits::{Block as BlockT, Header as HeaderT};
use substrate_service::ServiceFactory;
use transaction_factory::RuntimeAdapter;
Expand All @@ -54,6 +54,7 @@ pub struct FactoryState<N> {

type Number = <<node_primitives::Block as BlockT>::Header as HeaderT>::Number;

// TODO: fix the tip amount here.
impl RuntimeAdapter for FactoryState<Number> {
type AccountId = node_primitives::AccountId;
type Balance = node_primitives::Balance;
Expand Down Expand Up @@ -140,7 +141,8 @@ impl RuntimeAdapter for FactoryState<Number> {
),
(*amount).into()
)
)
),
tip: Tip::default(),
}, key, &prior_block_hash, phase)
}

Expand Down Expand Up @@ -246,11 +248,13 @@ fn sign<F: ServiceFactory, RA: RuntimeAdapter>(
UncheckedExtrinsic {
signature: Some((indices::address::Address::Id(signed), signature, payload.0, era)),
function: payload.1,
tip: Tip::default(),
}
}
None => UncheckedExtrinsic {
signature: None,
function: xt.function,
tip: Tip::default(),
},
};

Expand Down
4 changes: 2 additions & 2 deletions node/runtime/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -277,9 +277,9 @@ pub type SignedBlock = generic::SignedBlock<Block>;
/// BlockId type as expected by this runtime.
pub type BlockId = generic::BlockId<Block>;
/// Unchecked extrinsic type as expected by this runtime.
pub type UncheckedExtrinsic = generic::UncheckedMortalCompactExtrinsic<Address, Index, Call, Signature>;
pub type UncheckedExtrinsic = generic::UncheckedMortalCompactExtrinsic<Address, Index, Call, Signature, Balance>;
/// Extrinsic type that has already been checked.
pub type CheckedExtrinsic = generic::CheckedExtrinsic<AccountId, Index, Call>;
pub type CheckedExtrinsic = generic::CheckedExtrinsic<AccountId, Index, Call, Balance>;
/// Executive: handles dispatch to the various modules.
pub type Executive = executive::Executive<Runtime, Block, system::ChainContext<Runtime>, Balances, Runtime, AllModules>;

Expand Down
5 changes: 4 additions & 1 deletion srml/support/src/inherent.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ pub use crate::rstd::vec::Vec;
pub use crate::runtime_primitives::traits::{Block as BlockT, Extrinsic};
#[doc(hidden)]
pub use inherents::{InherentData, ProvideInherent, CheckInherentsResult, IsFatalError};
#[doc(hidden)]
pub use crate::runtime_primitives::generic::Tip;


/// Implement the outer inherent.
Expand Down Expand Up @@ -58,10 +60,11 @@ macro_rules! impl_outer_inherent {

let mut inherents = Vec::new();

// TODO: fix tip value here.
$(
if let Some(inherent) = $module::create_inherent(self) {
inherents.push($uncheckedextrinsic::new_unsigned(
Call::$call(inherent))
Call::$call(inherent), $crate::inherent::Tip::default())
);
}
)*
Expand Down
2 changes: 1 addition & 1 deletion srml/support/test/tests/instance.rs
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ srml_support::construct_runtime!(

pub type Header = generic::Header<BlockNumber, BlakeTwo256>;
pub type Block = generic::Block<Header, UncheckedExtrinsic>;
pub type UncheckedExtrinsic = generic::UncheckedMortalCompactExtrinsic<u32, Index, Call, Signature>;
pub type UncheckedExtrinsic = generic::UncheckedMortalCompactExtrinsic<u32, Index, Call, Signature, u32>;

fn new_test_ext() -> runtime_io::TestExternalities<Blake2Hasher> {
GenesisConfig{
Expand Down