Skip to content
Snippets Groups Projects
user avatar
Cecile Tonglet authored
* Initial commit

Forked at: 601e2fa1
Parent branch: origin/master

* WIP

Forked at: 601e2fa1
Parent branch: origin/master

* WIP

Forked at: 601e2fa1
Parent branch: origin/master

* WIP

Forked at: 601e2fa1
Parent branch: origin/master

* WIP

Forked at: 601e2fa1
Parent branch: origin/master

* WIP

Forked at: 601e2fa1
Parent branch: origin/master

* CLEANUP

Forked at: 601e2fa1
Parent branch: origin/master

* Add notes to original source code

* CLEANUP

Forked at: 601e2fa1
Parent branch: origin/master

* CLEANUP

Forked at: 601e2fa1
Parent branch: origin/master

* WIP

Forked at: 601e2fa1
Parent branch: origin/master

* WIP

Forked at: 601e2fa1
Parent branch: origin/master

* WIP

Forked at: 601e2fa1
Parent branch: origin/master

* CLEANUP

Forked at: 601e2fa1
Parent branch: origin/master

* WIP

Forked at: 601e2fa1
Parent branch: origin/master

* Some doc

* Test with trybuild

* Revert "Test with trybuild" (issue with trybuild atm)

This reverts commit 9055ec2206808ba3ddce6e3d87eb358907fa5e42.

https://github.com/dtolnay/trybuild/issues/53

* Apply suggestions

* Rename derive to proc-macro

* Remove "prefix" feature from informant

* Blocking task should use SpawnHandle::spawn_blocking

* Improve doc as suggested

* Fixes

Forked at: 601e2fa1


Parent branch: origin/master

* Apply suggestion

* Update client/cli/proc-macro/src/lib.rs

Co-authored-by: default avatarBastian Köcher <bkchr@users.noreply.github.com>

* More suggestions

* CLEANUP

Forked at: 601e2fa1
Parent branch: origin/master

* Improve error message

* CLEANUP

Forked at: 601e2fa1
Parent branch: origin/master

* Fix async issue

* CLEANUP

Forked at: 601e2fa1
Parent branch: origin/master

* CLEANUP

Forked at: 601e2fa1


Parent branch: origin/master

* Add test

* fix doc test

* Update client/cli/src/logging.rs

Co-authored-by: default avatarBastian Köcher <bkchr@users.noreply.github.com>

* Update client/basic-authorship/src/basic_authorship.rs

Co-authored-by: default avatarBastian Köcher <bkchr@users.noreply.github.com>

* Update client/basic-authorship/src/basic_authorship.rs

Co-authored-by: default avatarBastian Köcher <bkchr@users.noreply.github.com>

* Apply suggestions

* Suggestions

* Clarify doc

* WIP

Forked at: 601e2fa1


Parent branch: origin/master

Co-authored-by: default avatarBastian Köcher <bkchr@users.noreply.github.com>
8cebbd14
Name Last commit Last update
..
src
Cargo.toml
README.md

Basic implementation of block-authoring logic.

Example

// The first step is to create a `ProposerFactory`.
let mut proposer_factory = ProposerFactory::new(client.clone(), txpool.clone(), None);

// From this factory, we create a `Proposer`.
let proposer = proposer_factory.init(
	&client.header(&BlockId::number(0)).unwrap().unwrap(),
);

// The proposer is created asynchronously.
let proposer = futures::executor::block_on(proposer).unwrap();

// This `Proposer` allows us to create a block proposition.
// The proposer will grab transactions from the transaction pool, and put them into the block.
let future = proposer.propose(
	Default::default(),
	Default::default(),
	Duration::from_secs(2),
	RecordProof::Yes,
);

// We wait until the proposition is performed.
let block = futures::executor::block_on(future).unwrap();
println!("Generated block: {:?}", block.block);

License: GPL-3.0-or-later WITH Classpath-exception-2.0