Skip to content

Commit

Permalink
Use H160 as AccountId (#55)
Browse files Browse the repository at this point in the history
* Configure `H160` for runtime

* Configure `H160` genesis

Signed-off-by: Xavier Lau <xavier@inv.cafe>

* Docs

* Improve code

* Add missing features

* Format and enable missing features for #50

* Format

* Fix evm config

* Revert the rename

Signed-off-by: Xavier Lau <xavier@inv.cafe>
Co-authored-by: bear <boundless.forest@outlook.com>
  • Loading branch information
AurevoirXavier and boundless-forest authored Nov 22, 2022
1 parent 4b40193 commit c841631
Show file tree
Hide file tree
Showing 16 changed files with 352 additions and 197 deletions.
166 changes: 149 additions & 17 deletions Cargo.lock

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

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ panic = "unwind"
members = [
"core/*",
"node",
"precompiles/*",
"runtime/*",
"precompiles/*"
]
9 changes: 8 additions & 1 deletion core/primitives/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,19 @@ repository = "https://github.com/darwinia-network/darwinia"
version = "6.0.0"

[dependencies]
sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30" }
# moonbeam
account = { default-features = false, git = "https://github.com/darwinia-network/moonbeam", branch = "polkadot-v0.9.30" }
# substrate
sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30" }
sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30" }


[features]
default = ["std"]
std = [
# moonbeam
"account/std",
# substrate
"sp-core/std",
"sp-runtime/std",
]
7 changes: 2 additions & 5 deletions core/primitives/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
#![deny(missing_docs)]

/// Alias to 512-bit hash when used in the context of a transaction signature on the chain.
pub type Signature = sp_runtime::MultiSignature;
pub type Signature = account::EthereumSignature;

/// Some way of identifying an account on the chain.
/// We intentionally make it equivalent to the public key of our transaction signing scheme.
Expand All @@ -50,7 +50,7 @@ pub type Hash = sp_core::H256;
pub type BlockNumber = u32;

/// The address format for describing accounts.
pub type Address = sp_runtime::MultiAddress<AccountId, ()>;
pub type Address = AccountId;

/// Hashing type
pub type Hashing = sp_runtime::traits::BlakeTwo256;
Expand Down Expand Up @@ -97,6 +97,3 @@ pub const MWEI: Balance = 1_000 * KWEI;
pub const KWEI: Balance = 1_000 * WEI;
/// 1 wei — 1
pub const WEI: Balance = 1;

/// Darwinia EVM addresses specific prefix.
pub const EVM_ADDR_PREFIX: &[u8] = b"dvm:";
Loading

0 comments on commit c841631

Please sign in to comment.