Refactor (#7)

* Increment nonce when submitting transaction.

* Refactor.

* use default values from metadata
* use functions from metadata

* Nonce fixup

* Add docs.

* Add contracts module.

* Add set_code.

* Add events to metadata.

* Support pretty printing metadata.

* Add subscriptions.

* Add submit_and_watch to XtBuilder.

* nits from review
This commit is contained in:
David Craven
2019-08-12 17:07:28 +02:00
committed by GitHub
parent be5ccc1d11
commit 151c7f7e0a
9 changed files with 888 additions and 267 deletions
+19
View File
@@ -0,0 +1,19 @@
use parity_scale_codec::{
Encode,
EncodeAsRef,
HasCompact,
};
pub struct Encoded(pub Vec<u8>);
impl Encode for Encoded {
fn encode(&self) -> Vec<u8> {
self.0.to_owned()
}
}
pub fn compact<T: HasCompact>(t: T) -> Encoded {
let encodable: <<T as HasCompact>::Type as EncodeAsRef<'_, T>>::RefType =
From::from(&t);
Encoded(encodable.encode())
}