mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-09 20:11:09 +00:00
Fixed transaction propagation (#850)
This commit is contained in:
committed by
Gav Wood
parent
cad28aa283
commit
a5a7dd2480
@@ -72,6 +72,7 @@ use version::NativeVersion;
|
||||
pub use runtime_primitives::BuildStorage;
|
||||
pub use consensus::Call as ConsensusCall;
|
||||
pub use timestamp::Call as TimestampCall;
|
||||
pub use balances::Call as BalancesCall;
|
||||
pub use runtime_primitives::{Permill, Perbill};
|
||||
pub use timestamp::BlockPeriod;
|
||||
pub use srml_support::StorageValue;
|
||||
|
||||
@@ -19,6 +19,7 @@ node-consensus = { path = "../consensus" }
|
||||
node-network = { path = "../network" }
|
||||
node-transaction-pool = { path = "../transaction-pool" }
|
||||
sr-io = { path = "../../core/sr-io" }
|
||||
sr-primitives = { path = "../../core/sr-primitives" }
|
||||
substrate-primitives = { path = "../../core/primitives" }
|
||||
substrate-network = { path = "../../core/network" }
|
||||
substrate-client = { path = "../../core/client" }
|
||||
|
||||
@@ -45,7 +45,8 @@ extern crate substrate_bft as bft;
|
||||
extern crate substrate_test_client;
|
||||
#[cfg(test)]
|
||||
extern crate substrate_keyring as keyring;
|
||||
|
||||
#[cfg(test)]
|
||||
extern crate sr_primitives as runtime_primitives;
|
||||
pub mod chain_spec;
|
||||
|
||||
use std::sync::Arc;
|
||||
@@ -213,12 +214,18 @@ mod tests {
|
||||
use {service, service_test, Factory, chain_spec};
|
||||
use consensus::{self, OfflineTracker};
|
||||
use primitives::ed25519;
|
||||
use runtime_primitives::traits::BlockNumberToHash;
|
||||
use runtime_primitives::generic::Era;
|
||||
use node_primitives::Block;
|
||||
use bft::{Proposer, Environment};
|
||||
use node_network::consensus::ConsensusNetwork;
|
||||
use substrate_test_client::fake_justify;
|
||||
use node_primitives::BlockId;
|
||||
use keyring::Keyring;
|
||||
use node_runtime::{UncheckedExtrinsic, Call, BalancesCall};
|
||||
use node_primitives::UncheckedExtrinsic as OpaqueExtrinsic;
|
||||
use codec::{Decode, Encode};
|
||||
use node_runtime::RawAddress;
|
||||
|
||||
#[test]
|
||||
fn test_connectivity() {
|
||||
@@ -251,7 +258,18 @@ mod tests {
|
||||
let justification = service.client().check_justification(block.header, justification).unwrap();
|
||||
(justification, Some(block.extrinsics))
|
||||
};
|
||||
service_test::sync::<Factory, _>(chain_spec::integration_test_config(), block_factory);
|
||||
let extrinsic_factory = |service: &<Factory as service::ServiceFactory>::FullService| {
|
||||
let payload = (0, Call::Balances(BalancesCall::transfer(RawAddress::Id(bob.public().0.into()), 69)), Era::immortal(), service.client().genesis_hash());
|
||||
let signature = alice.sign(&payload.encode()).into();
|
||||
let id = alice.public().0.into();
|
||||
let xt = UncheckedExtrinsic {
|
||||
signature: Some((RawAddress::Id(id), signature, payload.0, Era::immortal())),
|
||||
function: payload.1,
|
||||
}.encode();
|
||||
let v: Vec<u8> = Decode::decode(&mut xt.as_slice()).unwrap();
|
||||
OpaqueExtrinsic(v)
|
||||
};
|
||||
service_test::sync::<Factory, _, _>(chain_spec::integration_test_config(), block_factory, extrinsic_factory);
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
||||
Reference in New Issue
Block a user