Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fork aware tx pool + no training wheels = 🚀🚀🚀 #4693

Closed
wants to merge 108 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
108 commits
Select commit Hold shift + click to select a range
4965180
txpool: internal crate reorg
michalkucharczyk May 23, 2024
e6ca18e
References to transaction pool are now Unsized
michalkucharczyk May 23, 2024
3a65f84
transaction pool type option added + txpool::builder used
michalkucharczyk May 23, 2024
5b998cc
make clippy happy: more fixes here and there
michalkucharczyk May 23, 2024
e451a82
version bumps
michalkucharczyk May 24, 2024
cd3717d
prdoc added
michalkucharczyk May 24, 2024
8d98809
license added
michalkucharczyk May 24, 2024
4f73653
Cargo.lock updated
michalkucharczyk May 24, 2024
11e16e6
Revert "version bumps"
michalkucharczyk May 27, 2024
2232372
Cargo.lock
michalkucharczyk May 27, 2024
5fea9a4
Revert "txpool: internal crate reorg"
michalkucharczyk May 29, 2024
0905129
there must be some starting point
michalkucharczyk Nov 29, 2023
3d8bf46
sketch
michalkucharczyk Dec 1, 2023
993eb11
txpool: test api: support for nonces per hash added
michalkucharczyk Dec 11, 2023
1bd6f76
txpool: test api: support for stale transactions
michalkucharczyk Dec 12, 2023
866137b
fork_aware_pool: some initial impl + tests
michalkucharczyk Dec 12, 2023
fb2b7fa
txpool: tests: fixes
michalkucharczyk Dec 12, 2023
aeee697
txpool: api: Hash -> HashAndNumber + get rid of Result
michalkucharczyk Dec 12, 2023
77419c4
txpool(fap): api: Hash -> HashAndNumber + get rid of Result
michalkucharczyk Dec 12, 2023
fdd1ef4
sumbit_at: at not used
michalkucharczyk Dec 18, 2023
00b9949
TransactionPool API: ready/ready_at/future at added
michalkucharczyk Jan 8, 2024
b015be1
Pool: deep_clone added
michalkucharczyk Jan 8, 2024
fc7a6be
txpool: test api: tx tag contains also account info
michalkucharczyk Jan 8, 2024
cc92ba4
fmt
michalkucharczyk Jan 8, 2024
3437a0a
TransactionPool API: ChainEvent derives Debug
michalkucharczyk Jan 8, 2024
c508b20
some progress
michalkucharczyk Jan 8, 2024
f705e13
tests added
michalkucharczyk Jan 9, 2024
6df33b0
multi_view_listener: some ideas
michalkucharczyk Jan 19, 2024
5923f49
finalization: tests added
michalkucharczyk Jan 19, 2024
374d9b1
fork_aware_pool: finalization + tree_route bug fixed
michalkucharczyk Jan 19, 2024
83f397a
logs here and there...
michalkucharczyk Jan 23, 2024
4505e3d
validated_pool: bug fix
michalkucharczyk Jan 23, 2024
c8aefbb
validated_pool + listener: util functions
michalkucharczyk Jan 23, 2024
f82bb36
submit_and_watch: somethig is working
michalkucharczyk Jan 23, 2024
3e9792e
forks + finalization tweaks
michalkucharczyk Feb 6, 2024
4b1cb4c
debugs
michalkucharczyk Feb 6, 2024
ea6905b
debugs
michalkucharczyk Feb 8, 2024
3143192
events and finalization works fine
michalkucharczyk Feb 8, 2024
b714f31
debug
michalkucharczyk Feb 8, 2024
a6f48fb
some fixes for no-views scenario
michalkucharczyk Mar 6, 2024
b5ed3dd
revalidation: initial implementation
michalkucharczyk Mar 8, 2024
24760ac
submit_and_watch: handling error fixed
michalkucharczyk Mar 12, 2024
9d77eaa
debug messages
michalkucharczyk Mar 12, 2024
65598f4
puring on finalization
michalkucharczyk Mar 21, 2024
cab4ac6
mempool / purging in background
michalkucharczyk Mar 25, 2024
b65e914
little cleanup
michalkucharczyk Mar 28, 2024
0d73839
some progress
michalkucharczyk Apr 4, 2024
27ec53d
...
michalkucharczyk Apr 8, 2024
cd9349e
rebase fixes
michalkucharczyk Apr 8, 2024
555db3c
txpool naive test for parachain ressurected
michalkucharczyk Apr 15, 2024
933d612
Hash: Unpin added where needed
michalkucharczyk Apr 15, 2024
655998e
client integration: bounds
michalkucharczyk Apr 15, 2024
0cd5b60
client integration: rpc
michalkucharczyk Apr 15, 2024
8392a0f
client integration: basic authorship
michalkucharczyk Apr 15, 2024
3b265ba
client integration: txpool: hacks
michalkucharczyk Apr 15, 2024
2879e7a
import notification sink added
michalkucharczyk Apr 22, 2024
cf79425
tests for sink
michalkucharczyk Apr 22, 2024
57c14a3
make old tests working
michalkucharczyk Apr 22, 2024
da84b80
multi_view: tests added
michalkucharczyk Apr 23, 2024
505b7a6
tests adjusted
michalkucharczyk May 6, 2024
4a9d676
chain-api: mutex removed, timings added
michalkucharczyk May 6, 2024
82276ca
client: tx import: timings added
michalkucharczyk May 6, 2024
f175784
network-transactions: received debug added
michalkucharczyk May 6, 2024
ce2f7da
import_sink_notiifcation: debugs
michalkucharczyk May 6, 2024
9d733a7
multi_view_listener: better debugs
michalkucharczyk May 6, 2024
686fa44
network-transactions: error + debugs added
michalkucharczyk May 6, 2024
4033075
txpool: debug level changed
michalkucharczyk May 6, 2024
168b368
validated_pool: debugs + timings added
michalkucharczyk May 6, 2024
adcc9a8
graph::pool: debugs + timings added
michalkucharczyk May 6, 2024
a76ad77
basic-authorship: debugs
michalkucharczyk May 6, 2024
5adbf57
fork-pool: debugs + timings added
michalkucharczyk May 6, 2024
d292b48
fork-pool: view: accept_xts added
michalkucharczyk May 6, 2024
beffdf2
fork-pool: view: ready transactions fixed
michalkucharczyk May 6, 2024
f485974
fork-pool: stats
michalkucharczyk May 6, 2024
effa85a
fork-pool: panic -> error
michalkucharczyk May 6, 2024
14474ba
fork-pool: view: accept_xts added - disabling views
michalkucharczyk May 6, 2024
8362c47
fork-pool: find_view - dir reversed
michalkucharczyk May 6, 2024
1ccb5c8
fork-pool: ref added
michalkucharczyk May 6, 2024
1d612bf
fork-pool: revalidation disabled
michalkucharczyk May 6, 2024
04c1cb5
fork-pool: todo added
michalkucharczyk May 6, 2024
df44d92
view_revalidation: debugs
michalkucharczyk May 6, 2024
cb5a34c
zombienet spam test
michalkucharczyk May 6, 2024
55f2166
multi_view_listener: finalization support added
michalkucharczyk May 6, 2024
bc899d3
tests adjusted again
michalkucharczyk May 6, 2024
3e3053a
fork-pool: finalization simplified
michalkucharczyk May 6, 2024
63f87d4
fork-pool: debugs aligned
michalkucharczyk May 16, 2024
a49201e
graph: type exposed
michalkucharczyk May 16, 2024
b1db4ed
graph: stats added
michalkucharczyk May 16, 2024
0ed9b75
tests: adjusted for new revalidation
michalkucharczyk May 16, 2024
7876a19
fork-pool: yet another revalidation approach
michalkucharczyk May 16, 2024
b7bfa13
fork-pool: view revalidation removed
michalkucharczyk May 16, 2024
fc64ad5
txpool: itertools added
michalkucharczyk May 16, 2024
92c42a1
plots: some tooling
michalkucharczyk May 16, 2024
6ea0547
spamming-zombie: debug levels fixed
michalkucharczyk May 16, 2024
77f666e
minors improvements
michalkucharczyk May 20, 2024
a0a73b5
crate structure improved
michalkucharczyk May 20, 2024
447ea3b
format + warnings + small fix
michalkucharczyk May 20, 2024
d348087
some groundwork for selecting implementation
michalkucharczyk May 23, 2024
b0f72e9
reference to transaction pool in now Unsized
michalkucharczyk May 23, 2024
4df5e44
txpool builder: integrated
michalkucharczyk May 23, 2024
196382e
fixing merging leftovers
michalkucharczyk May 29, 2024
3eff3db
debugs reverted
michalkucharczyk May 29, 2024
06eb6de
api fixes
michalkucharczyk May 29, 2024
23fd102
fixing clippy and warnings
michalkucharczyk May 29, 2024
c4e3ad6
adding fork_aware_txpool to builder
michalkucharczyk May 29, 2024
7c92b01
substrate-frame-rpc-system: test reverted to single-state pool
michalkucharczyk May 29, 2024
303e7d6
Remove the training wheels
bkchr Jun 4, 2024
7bec303
Merge remote-tracking branch 'origin/master' into bkchr-fork-aware-tx…
bkchr Jun 4, 2024
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
6 changes: 6 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 1 addition & 5 deletions cumulus/client/consensus/aura/src/collators/lookahead.rs
Original file line number Diff line number Diff line change
Expand Up @@ -387,11 +387,7 @@ where
None,
(parachain_inherent_data, other_inherent_data),
params.authoring_duration,
// Set the block limit to 50% of the maximum PoV size.
//
// TODO: If we got benchmarking that includes the proof size,
// we should be able to use the maximum pov size.
(validation_data.max_pov_size / 2) as usize,
validation_data.max_pov_size as usize,
)
.await
{
Expand Down
4 changes: 3 additions & 1 deletion cumulus/client/service/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -411,12 +411,13 @@ pub struct BuildNetworkParams<
IQ,
> where
Client::Api: sp_transaction_pool::runtime_api::TaggedTransactionQueue<Block>,
<Block as BlockT>::Hash: std::marker::Unpin,
{
pub parachain_config: &'a Configuration,
pub net_config:
sc_network::config::FullNetworkConfiguration<Block, <Block as BlockT>::Hash, Network>,
pub client: Arc<Client>,
pub transaction_pool: Arc<sc_transaction_pool::FullPool<Block, Client>>,
pub transaction_pool: Arc<sc_transaction_pool::TransactionPoolImpl<Block, Client>>,
pub para_id: ParaId,
pub relay_chain_interface: RCInterface,
pub spawn_handle: SpawnTaskHandle,
Expand Down Expand Up @@ -446,6 +447,7 @@ pub async fn build_network<'a, Block, Client, RCInterface, IQ, Network>(
)>
where
Block: BlockT,
<Block as BlockT>::Hash: std::marker::Unpin,
Client: UsageProvider<Block>
+ HeaderBackend<Block>
+ sp_consensus::block_validation::Chain<Block>
Expand Down
6 changes: 3 additions & 3 deletions cumulus/polkadot-parachain/src/rpc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ use sp_blockchain::{Error as BlockChainError, HeaderBackend, HeaderMetadata};
pub type RpcExtension = jsonrpsee::RpcModule<()>;

/// Full client dependencies
pub struct FullDeps<C, P> {
pub struct FullDeps<C, P: ?Sized> {
/// The client instance to use.
pub client: Arc<C>,
/// Transaction pool instance.
Expand All @@ -57,7 +57,7 @@ where
C::Api: frame_rpc_system::AccountNonceApi<Block, AccountId, Nonce>,
C::Api: pallet_transaction_payment_rpc::TransactionPaymentRuntimeApi<Block, Balance>,
C::Api: BlockBuilder<Block>,
P: TransactionPool + Sync + Send + 'static,
P: TransactionPool<Block = Block> + Sync + Send + 'static + ?Sized,
B: sc_client_api::Backend<Block> + Send + Sync + 'static,
B::State: sc_client_api::backend::StateBackend<sp_runtime::traits::HashingFor<Block>>,
{
Expand Down Expand Up @@ -91,7 +91,7 @@ where
C::Api: frame_rpc_system::AccountNonceApi<Block, AccountId, Nonce>,
C::Api: pallet_transaction_payment_rpc::TransactionPaymentRuntimeApi<Block, Balance>,
C::Api: BlockBuilder<Block>,
P: TransactionPool + Sync + Send + 'static,
P: TransactionPool<Block = Block> + Sync + Send + 'static + ?Sized,
{
use frame_rpc_system::{System, SystemApiServer};
use pallet_transaction_payment_rpc::{TransactionPayment, TransactionPaymentApiServer};
Expand Down
33 changes: 19 additions & 14 deletions cumulus/polkadot-parachain/src/service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ pub type Service<RuntimeApi> = PartialComponents<
ParachainBackend,
(),
sc_consensus::DefaultImportQueue<Block>,
sc_transaction_pool::FullPool<Block, ParachainClient<RuntimeApi>>,
sc_transaction_pool::TransactionPoolImpl<Block, ParachainClient<RuntimeApi>>,
(ParachainBlockImport<RuntimeApi>, Option<Telemetry>, Option<TelemetryWorkerHandle>),
>;

Expand Down Expand Up @@ -154,13 +154,14 @@ where
telemetry
});

let transaction_pool = sc_transaction_pool::BasicPool::new_full(
config.transaction_pool.clone(),
config.role.is_authority().into(),
config.prometheus_registry(),
task_manager.spawn_essential_handle(),
client.clone(),
);
let transaction_pool = sc_transaction_pool::Builder::new()
.with_options(config.transaction_pool.clone())
.build(
config.role.is_authority().into(),
config.prometheus_registry(),
task_manager.spawn_essential_handle(),
client.clone(),
);

let block_import = ParachainBlockImport::new(client.clone(), backend.clone());

Expand Down Expand Up @@ -214,7 +215,7 @@ where
DenyUnsafe,
Arc<ParachainClient<RuntimeApi>>,
Arc<ParachainBackend>,
Arc<sc_transaction_pool::FullPool<Block, ParachainClient<RuntimeApi>>>,
Arc<sc_transaction_pool::TransactionPoolImpl<Block, ParachainClient<RuntimeApi>>>,
) -> Result<jsonrpsee::RpcModule<()>, sc_service::Error>
+ 'static,
BIQ: FnOnce(
Expand All @@ -231,7 +232,7 @@ where
Option<TelemetryHandle>,
&TaskManager,
Arc<dyn RelayChainInterface>,
Arc<sc_transaction_pool::FullPool<Block, ParachainClient<RuntimeApi>>>,
Arc<sc_transaction_pool::TransactionPoolImpl<Block, ParachainClient<RuntimeApi>>>,
Arc<SyncingService<Block>>,
KeystorePtr,
Duration,
Expand Down Expand Up @@ -464,7 +465,7 @@ fn build_parachain_rpc_extensions<RuntimeApi>(
deny_unsafe: sc_rpc::DenyUnsafe,
client: Arc<ParachainClient<RuntimeApi>>,
backend: Arc<ParachainBackend>,
pool: Arc<sc_transaction_pool::FullPool<Block, ParachainClient<RuntimeApi>>>,
pool: Arc<sc_transaction_pool::TransactionPoolImpl<Block, ParachainClient<RuntimeApi>>>,
) -> Result<jsonrpsee::RpcModule<()>, sc_service::Error>
where
RuntimeApi: ConstructRuntimeApi<Block, ParachainClient<RuntimeApi>> + Send + Sync + 'static,
Expand All @@ -482,7 +483,7 @@ fn build_contracts_rpc_extensions(
deny_unsafe: sc_rpc::DenyUnsafe,
client: Arc<ParachainClient<FakeRuntimeApi>>,
_backend: Arc<ParachainBackend>,
pool: Arc<sc_transaction_pool::FullPool<Block, ParachainClient<FakeRuntimeApi>>>,
pool: Arc<sc_transaction_pool::TransactionPoolImpl<Block, ParachainClient<FakeRuntimeApi>>>,
) -> Result<jsonrpsee::RpcModule<()>, sc_service::Error> {
let deps = crate::rpc::FullDeps { client: client.clone(), pool: pool.clone(), deny_unsafe };

Expand Down Expand Up @@ -866,7 +867,9 @@ fn start_relay_chain_consensus(
telemetry: Option<TelemetryHandle>,
task_manager: &TaskManager,
relay_chain_interface: Arc<dyn RelayChainInterface>,
transaction_pool: Arc<sc_transaction_pool::FullPool<Block, ParachainClient<FakeRuntimeApi>>>,
transaction_pool: Arc<
sc_transaction_pool::TransactionPoolImpl<Block, ParachainClient<FakeRuntimeApi>>,
>,
_sync_oracle: Arc<SyncingService<Block>>,
_keystore: KeystorePtr,
_relay_chain_slot_duration: Duration,
Expand Down Expand Up @@ -937,7 +940,9 @@ fn start_lookahead_aura_consensus(
telemetry: Option<TelemetryHandle>,
task_manager: &TaskManager,
relay_chain_interface: Arc<dyn RelayChainInterface>,
transaction_pool: Arc<sc_transaction_pool::FullPool<Block, ParachainClient<FakeRuntimeApi>>>,
transaction_pool: Arc<
sc_transaction_pool::TransactionPoolImpl<Block, ParachainClient<FakeRuntimeApi>>,
>,
sync_oracle: Arc<SyncingService<Block>>,
keystore: KeystorePtr,
relay_chain_slot_duration: Duration,
Expand Down
2 changes: 1 addition & 1 deletion cumulus/test/service/benches/transaction_throughput.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ use criterion::{criterion_group, criterion_main, BatchSize, Criterion, Throughpu
use cumulus_client_cli::get_raw_genesis_header;
use cumulus_test_runtime::{AccountId, BalancesCall, ExistentialDeposit, SudoCall};
use futures::{future, StreamExt};
use sc_transaction_pool_api::{TransactionPool as _, TransactionSource, TransactionStatus};
use sc_transaction_pool_api::{TransactionSource, TransactionStatus};
use sp_core::{crypto::Pair, sr25519};
use sp_runtime::OpaqueExtrinsic;

Expand Down
19 changes: 10 additions & 9 deletions cumulus/test/service/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ pub type Backend = TFullBackend<Block>;
pub type ParachainBlockImport = TParachainBlockImport<Block, Arc<Client>, Backend>;

/// Transaction pool type used by the test service
pub type TransactionPool = Arc<sc_transaction_pool::FullPool<Block, Client>>;
pub type TransactionPool = Arc<sc_transaction_pool::TransactionPoolImpl<Block, Client>>;

/// Recovery handle that fails regularly to simulate unavailable povs.
pub struct FailingRecoveryHandle {
Expand Down Expand Up @@ -178,7 +178,7 @@ pub type Service = PartialComponents<
Backend,
(),
sc_consensus::import_queue::BasicQueue<Block>,
sc_transaction_pool::FullPool<Block, Client>,
sc_transaction_pool::TransactionPoolImpl<Block, Client>,
ParachainBlockImport,
>;

Expand Down Expand Up @@ -213,13 +213,14 @@ pub fn new_partial(

let block_import = ParachainBlockImport::new(client.clone(), backend.clone());

let transaction_pool = sc_transaction_pool::BasicPool::new_full(
config.transaction_pool.clone(),
config.role.is_authority().into(),
config.prometheus_registry(),
task_manager.spawn_essential_handle(),
client.clone(),
);
let transaction_pool = sc_transaction_pool::Builder::new()
.with_options(config.transaction_pool.clone())
.build(
config.role.is_authority().into(),
config.prometheus_registry(),
task_manager.spawn_essential_handle(),
client.clone(),
);

let slot_duration = sc_consensus_aura::slot_duration(&*client)?;
let import_queue = cumulus_client_consensus_aura::import_queue::<AuthorityPair, _, _, _, _, _>(
Expand Down
18 changes: 18 additions & 0 deletions cumulus/zombienet/tests/0008-main.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
// Allows to manually submit extrinsic to collator.
// Usage:
// zombienet-linux -p native spwan 0008-parachain-extrinsic-gets-finalized.toml
// node 0008-main.js <path-to-generated-tmpdir/zombie.json>

global.zombie = null

const fs = require('fs');
const test = require('./0008-transaction_gets_finalized.js');

if (process.argv.length == 2) {
console.error('Path to zombie.json (generated by zombienet-linux spawn command shall be given)!');
process.exit(1);
}

let networkInfo = JSON.parse(fs.readFileSync(process.argv[2]));

test.run("charlie", networkInfo).then(process.exit)
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
[relaychain]
default_image = "{{RELAY_IMAGE}}"
default_command = "polkadot"
chain = "rococo-local"

[[relaychain.nodes]]
name = "alice"
validator = true

[[relaychain.nodes]]
name = "bob"
validator = true

[[parachains]]
id = 2000
cumulus_based = true
chain = "asset-hub-rococo-local"

# run charlie as parachain collator
[[parachains.collators]]
name = "charlie"
validator = true
image = "{{POLKADOT_PARACHAIN_IMAGE}}"
command = "polkadot-parachain"
args = ["--force-authoring", "-ltxpool=trace"]
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
Description: Block building
Network: ./0008-parachain_extrinsic_gets_finalized.toml
Creds: config

alice: reports node_roles is 4
bob: reports node_roles is 4
charlie: reports node_roles is 4

alice: reports peers count is at least 1
bob: reports peers count is at least 1

alice: reports block height is at least 5 within 60 seconds
bob: reports block height is at least 5 within 60 seconds
charlie: reports block height is at least 2 within 120 seconds

alice: count of log lines containing "error" is 0 within 2 seconds
bob: count of log lines containing "error" is 0 within 2 seconds
charlie: count of log lines containing "error" is 0 within 2 seconds

charlie: js-script ./0008-transaction_gets_finalized.js within 600 seconds
77 changes: 77 additions & 0 deletions cumulus/zombienet/tests/0008-transaction_gets_finalized.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
//based on: https://polkadot.js.org/docs/api/examples/promise/transfer-events

const assert = require("assert");

async function run(nodeName, networkInfo, args) {
// console.log('xxxxxxxxxxx 1');
const {wsUri, userDefinedTypes} = networkInfo.nodesByName[nodeName];
// console.log('xxxxxxxxxxx 2');
// Create the API and wait until ready
var api = null;
var keyring = null;
if (zombie == null) {
const testKeyring = require('@polkadot/keyring/testing');
const { WsProvider, ApiPromise } = require('@polkadot/api');
const provider = new WsProvider(wsUri);
api = await ApiPromise.create({provider});
// Construct the keyring after the API (crypto has an async init)
keyring = testKeyring.createTestKeyring({ type: "sr25519" });
} else {
keyring = new zombie.Keyring({ type: "sr25519" });
// console.log('xxxxxxxxxxx 3');
api = await zombie.connect(wsUri, userDefinedTypes);
// console.log('xxxxxxxxxxx 4');
}


// Add Alice to our keyring with a hard-derivation path (empty phrase, so uses dev)
const alice = keyring.addFromUri('//Alice');
// console.log('xxxxxxxxxxx 5');

// Create a extrinsic:
const extrinsic = api.tx.system.remark("xxx");
// console.log('xxxxxxxxxxx 6');

let extrinsic_success_event = false;
try {
// console.log('xxxxxxxxxxx 7');
await new Promise( async (resolve, reject) => {
const unsubscribe = await extrinsic
.signAndSend(alice, { nonce: -1 }, ({ events = [], status }) => {
console.log('Extrinsic status:', status.type);

if (status.isInBlock) {
console.log('Included at block hash', status.asInBlock.toHex());
console.log('Events:');

events.forEach(({ event: { data, method, section }, phase }) => {
console.log('\t', phase.toString(), `: ${section}.${method}`, data.toString());

if (section=="system" && method =="ExtrinsicSuccess") {
extrinsic_success_event = true;
}
});
} else if (status.isFinalized) {
console.log('Finalized block hash', status.asFinalized.toHex());
unsubscribe();
if (extrinsic_success_event) {
resolve();
} else {
reject("ExtrinsicSuccess has not been seen");
}
} else if (status.isError) {
unsubscribe();
reject("Extrinsic status.isError");
}

});
});
// console.log('xxxxxxxxxxx 8');
} catch (error) {
assert.fail("Transfer promise failed, error: " + error);
}

assert.ok("test passed");
}

module.exports = { run }
Loading
Loading