mirror of
https://github.com/status-im/nimbus-eth1.git
synced 2025-01-12 05:14:14 +00:00
Add generateAddress utility
This commit is contained in:
parent
a7c1168b3a
commit
a28ef962b3
4
nimbus/utils/addresses.nim
Normal file
4
nimbus/utils/addresses.nim
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
import nimcrypto, eth_common, rlp
|
||||||
|
|
||||||
|
proc generateAddress*(address: EthAddress, nonce: AccountNonce): EthAddress =
|
||||||
|
result[0..19] = keccak256.digest(rlp.encodeList(address, nonce).toOpenArray).data[12..31]
|
@ -12,7 +12,7 @@ import
|
|||||||
./gas_meter, ./gas_costs, ./opcode_values, ./vm_forks,
|
./gas_meter, ./gas_costs, ./opcode_values, ./vm_forks,
|
||||||
../memory, ../message, ../stack, ../code_stream, ../computation,
|
../memory, ../message, ../stack, ../code_stream, ../computation,
|
||||||
../../vm_state, ../../errors, ../../constants, ../../vm_types,
|
../../vm_state, ../../errors, ../../constants, ../../vm_types,
|
||||||
../../db/[db_chain, state_db]
|
../../db/[db_chain, state_db], ../../utils/addresses
|
||||||
|
|
||||||
# ##################################
|
# ##################################
|
||||||
# Syntactic sugar
|
# Syntactic sugar
|
||||||
|
Loading…
x
Reference in New Issue
Block a user