parity-io

Fast forward time when writing Substrate Runtime Test

拥有回忆 提交于 2021-02-10 18:44:53
问题 I am writing an auction type application with Substrate runtime. In writing test case, how can I fast forward the blockchain time (what's retrieved from <timestamp::Module<T>>::get() ) so I can reach the auction closing time and test the closing logic? Thanks. 回答1: You can just use Timestamp::set_timestamp to change the timestamp to whatever value you want. e.g. Timestamp::set_timestamp(42); You can check the tests for srml-timestamp for examples https://github.com/paritytech/substrate/blob

What's the meaning of the ethereum Parity console output lines?

浪子不回头ぞ 提交于 2019-12-23 22:11:55
问题 Parity doesn't seem to have any documentation on what it's console output means. At least none that I've found which admittedly doesn't mean a whole lot. Can anyone give me a breakdown of the meaning of the following line? 2018-03-09 00:05:12 UTC Syncing #4896969 61ee…bdad 2 blk/s 508 tx/s 16 Mgas/s 645+ 1 Qed #4897616 17/25 peers 4 MiB chain 135 MiB db 42 MiB queue 5 MiB sync RPC: 0 conn, 0 req/s, 182 µs Thanks. 回答1: Why document when you can just read code? (bleh) 2018-03-09 00:05:12 UTC(1)

How to implement the EVM Trait for a Substrate Runtime?

↘锁芯ラ 提交于 2019-12-12 16:48:29
问题 Following the adding a module to your runtime, I'm trying to implement the Parity Substrate paint-evm trait for the Dothereum Runtime. The EVM module trait is defined as follows: pub trait Trait: Trait + Trait { type FeeCalculator: FeeCalculator; type ConvertAccountId: ConvertAccountId<Self::AccountId>; type Currency: Currency<Self::AccountId>; type Event: From<Event> + Into<Self::Event>; type Precompiles: Precompiles; } The adding a module tutorial here, however, is a bit vague and

In the oo7 Substrate UI, Alice has zero funds

一笑奈何 提交于 2019-12-11 15:15:24
问题 In the Substrate-UI using the Bonds library (oo7), it shows that "Alice" has zero funds on a development chain. I also notice that some accounts are labeled as ed25519 and other are sr25519 . How can I repair this and gain access to the correct Alice? 回答1: Recently, Substrate changed the default cryptography for accounts and transactions signing from ed25519 to sr25519 . Depending on what combination of software you are using (node, UI, etc...) and what local storage items you have stored

What is the purpose of `pub` in decl_storage?

﹥>﹥吖頭↗ 提交于 2019-12-11 10:03:51
问题 When implementing a runtime module in substrate, given the following storage decl_storage! { trait Store for Module<T: Trait> as CatAuction { Kitties get(kitties): map T::Hash => Kitty<T::Hash, T::Balance>; KittyOwner get(owner_of): map T::Hash => Option<T::AccountId>; OwnedKitties get(kitties_owned): map T::AccountId => T::Hash; pub AllKittiesCount get(all_kitties_cnt): u64; Nonce: u64; // if you want to initialize value in storage, use genesis block } } What is the purpose of pub in front