Fix contracts instantiation (#51)

* Move contracts tests to contracts module

* Add test for instantiating a contract

* Fix InstantiateArgs encoding

* Ignore PhantomData primitives, they are 0

* Increase endowment and log code hash

* Update SystemEvent

* Fix codec import

* Oops

* Write buffer directly to output to avoid encoding vec

* Debug with StorageChanges encoded as hex

* Logging and format code
This commit is contained in:
Andrew Jones
2019-12-17 09:39:56 +00:00
committed by GitHub
parent f1926f55cf
commit daa1415297
6 changed files with 159 additions and 58 deletions
+11 -2
View File
@@ -196,11 +196,20 @@ impl<T: System + Balances + 'static> Rpc<T> {
{
let mut storage_key = twox_128(b"System").to_vec();
storage_key.extend(twox_128(b"Events").to_vec());
log::debug!("Events storage key {:?}", storage_key);
log::debug!("Events storage key {:?}", hex::encode(&storage_key));
let closure: MapClosure<StorageChangeSet<<T as System>::Hash>> =
Box::new(|event| {
log::info!("Event {:?}", event);
log::debug!(
"Event {:?}",
event
.changes
.iter()
.map(|(k, v)| {
(hex::encode(&k.0), v.as_ref().map(|v| hex::encode(&v.0)))
})
.collect::<Vec<_>>()
);
event
});
self.state