mirror of
https://github.com/status-im/nimbus-eth1.git
synced 2025-01-24 19:19:21 +00:00
reduce more warnings
This commit is contained in:
parent
165f9fea2e
commit
207065746c
@ -1,3 +1,5 @@
|
|||||||
|
{.used.}
|
||||||
|
|
||||||
import
|
import
|
||||||
eth/common, nimcrypto/hash
|
eth/common, nimcrypto/hash
|
||||||
|
|
||||||
|
@ -49,8 +49,8 @@ proc start(nimbus: NimbusNode) =
|
|||||||
{.gcsafe.}:
|
{.gcsafe.}:
|
||||||
let registry = defaultRegistry
|
let registry = defaultRegistry
|
||||||
info "metrics", registry
|
info "metrics", registry
|
||||||
addTimer(Moment.fromNow(conf.debug.logMetricsInterval.seconds), logMetrics)
|
discard setTimer(Moment.fromNow(conf.debug.logMetricsInterval.seconds), logMetrics)
|
||||||
addTimer(Moment.fromNow(conf.debug.logMetricsInterval.seconds), logMetrics)
|
discard setTimer(Moment.fromNow(conf.debug.logMetricsInterval.seconds), logMetrics)
|
||||||
|
|
||||||
## Creating RPC Server
|
## Creating RPC Server
|
||||||
if RpcFlags.Enabled in conf.rpc.flags:
|
if RpcFlags.Enabled in conf.rpc.flags:
|
||||||
|
@ -28,7 +28,7 @@ import
|
|||||||
|
|
||||||
# Work around for https://github.com/nim-lang/Nim/issues/8645
|
# Work around for https://github.com/nim-lang/Nim/issues/8645
|
||||||
proc `%`*(value: Time): JsonNode =
|
proc `%`*(value: Time): JsonNode =
|
||||||
result = %value.toSeconds
|
result = %value.toUnix
|
||||||
|
|
||||||
template balance(addressDb: ReadOnlyStateDb, address: EthAddress): GasInt =
|
template balance(addressDb: ReadOnlyStateDb, address: EthAddress): GasInt =
|
||||||
# TODO: Account balance u256 but GasInt is int64?
|
# TODO: Account balance u256 but GasInt is int64?
|
||||||
@ -107,7 +107,6 @@ proc setupEthRpc*(node: EthereumNode, chain: BaseChainDB, rpcsrv: RpcServer) =
|
|||||||
# TODO: Requires PeerPool to check sync state.
|
# TODO: Requires PeerPool to check sync state.
|
||||||
# TODO: Use variant objects
|
# TODO: Use variant objects
|
||||||
var
|
var
|
||||||
res: JsonNode
|
|
||||||
sync: SyncState
|
sync: SyncState
|
||||||
if true:
|
if true:
|
||||||
# TODO: Populate sync state, this is a placeholder
|
# TODO: Populate sync state, this is a placeholder
|
||||||
@ -237,20 +236,19 @@ proc setupEthRpc*(node: EthereumNode, chain: BaseChainDB, rpcsrv: RpcServer) =
|
|||||||
## data: address.
|
## data: address.
|
||||||
## message: message to sign.
|
## message: message to sign.
|
||||||
## Returns signature.
|
## Returns signature.
|
||||||
let accountDb = getAccountDb(chain.getCanonicalHead())
|
|
||||||
var privateKey: PrivateKey # TODO: Get from key store
|
var privateKey: PrivateKey # TODO: Get from key store
|
||||||
result = ("0x" & sign(privateKey, message.string)).HexDataStr
|
result = ("0x" & sign(privateKey, message.string)).HexDataStr
|
||||||
|
|
||||||
proc setupTransaction(send: EthSend): Transaction =
|
# proc setupTransaction(send: EthSend): Transaction =
|
||||||
let
|
# let
|
||||||
source = send.source.toAddress
|
# source = send.source.toAddress
|
||||||
destination = send.to.toAddress
|
# destination = send.to.toAddress
|
||||||
data = nimcrypto.utils.fromHex(send.data.string)
|
# data = nimcrypto.utils.fromHex(send.data.string)
|
||||||
contractCreation = false # TODO: Check if has code
|
# contractCreation = false # TODO: Check if has code
|
||||||
v = 0.byte # TODO
|
# v = 0.byte # TODO
|
||||||
r = 0.u256
|
# r = 0.u256
|
||||||
s = 0.u256
|
# s = 0.u256
|
||||||
result = initTransaction(send.nonce, send.gasPrice, send.gas, destination, send.value, data, v, r, s, contractCreation)
|
# result = initTransaction(send.nonce, send.gasPrice, send.gas, destination, send.value, data, v, r, s, contractCreation)
|
||||||
|
|
||||||
rpcsrv.rpc("eth_sendTransaction") do(obj: EthSend) -> HexDataStr:
|
rpcsrv.rpc("eth_sendTransaction") do(obj: EthSend) -> HexDataStr:
|
||||||
## Creates new message call transaction or a contract creation, if the data field contains code.
|
## Creates new message call transaction or a contract creation, if the data field contains code.
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
import
|
import
|
||||||
times,
|
times, eth/common, stint,
|
||||||
eth/common, stint,
|
|
||||||
../constants, ../config
|
../constants, ../config
|
||||||
|
|
||||||
const
|
const
|
||||||
|
@ -9,9 +9,8 @@ import
|
|||||||
tables, macros,
|
tables, macros,
|
||||||
chronicles,
|
chronicles,
|
||||||
./interpreter/[opcode_values, opcodes_impl, vm_forks, gas_costs, gas_meter, utils/macros_gen_opcodes],
|
./interpreter/[opcode_values, opcodes_impl, vm_forks, gas_costs, gas_meter, utils/macros_gen_opcodes],
|
||||||
./code_stream,
|
./code_stream, ../vm_types, ../errors, precompiles, ./stack,
|
||||||
../vm_types, ../errors, precompiles,
|
terminal # Those are only needed for logging
|
||||||
./stack, terminal # Those are only needed for logging
|
|
||||||
|
|
||||||
logScope:
|
logScope:
|
||||||
topics = "vm opcode"
|
topics = "vm opcode"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user