reduce more warnings

This commit is contained in:
jangko 2020-07-21 13:25:27 +07:00
parent 165f9fea2e
commit 207065746c
No known key found for this signature in database
GPG Key ID: 31702AE10541E6B9
5 changed files with 18 additions and 20 deletions

View File

@ -1,3 +1,5 @@
{.used.}
import
eth/common, nimcrypto/hash

View File

@ -49,8 +49,8 @@ proc start(nimbus: NimbusNode) =
{.gcsafe.}:
let registry = defaultRegistry
info "metrics", registry
addTimer(Moment.fromNow(conf.debug.logMetricsInterval.seconds), logMetrics)
addTimer(Moment.fromNow(conf.debug.logMetricsInterval.seconds), logMetrics)
discard setTimer(Moment.fromNow(conf.debug.logMetricsInterval.seconds), logMetrics)
discard setTimer(Moment.fromNow(conf.debug.logMetricsInterval.seconds), logMetrics)
## Creating RPC Server
if RpcFlags.Enabled in conf.rpc.flags:

View File

@ -28,7 +28,7 @@ import
# Work around for https://github.com/nim-lang/Nim/issues/8645
proc `%`*(value: Time): JsonNode =
result = %value.toSeconds
result = %value.toUnix
template balance(addressDb: ReadOnlyStateDb, address: EthAddress): GasInt =
# 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: Use variant objects
var
res: JsonNode
sync: SyncState
if true:
# TODO: Populate sync state, this is a placeholder
@ -237,20 +236,19 @@ proc setupEthRpc*(node: EthereumNode, chain: BaseChainDB, rpcsrv: RpcServer) =
## data: address.
## message: message to sign.
## Returns signature.
let accountDb = getAccountDb(chain.getCanonicalHead())
var privateKey: PrivateKey # TODO: Get from key store
result = ("0x" & sign(privateKey, message.string)).HexDataStr
proc setupTransaction(send: EthSend): Transaction =
let
source = send.source.toAddress
destination = send.to.toAddress
data = nimcrypto.utils.fromHex(send.data.string)
contractCreation = false # TODO: Check if has code
v = 0.byte # TODO
r = 0.u256
s = 0.u256
result = initTransaction(send.nonce, send.gasPrice, send.gas, destination, send.value, data, v, r, s, contractCreation)
# proc setupTransaction(send: EthSend): Transaction =
# let
# source = send.source.toAddress
# destination = send.to.toAddress
# data = nimcrypto.utils.fromHex(send.data.string)
# contractCreation = false # TODO: Check if has code
# v = 0.byte # TODO
# r = 0.u256
# s = 0.u256
# result = initTransaction(send.nonce, send.gasPrice, send.gas, destination, send.value, data, v, r, s, contractCreation)
rpcsrv.rpc("eth_sendTransaction") do(obj: EthSend) -> HexDataStr:
## Creates new message call transaction or a contract creation, if the data field contains code.

View File

@ -1,6 +1,5 @@
import
times,
eth/common, stint,
times, eth/common, stint,
../constants, ../config
const

View File

@ -9,9 +9,8 @@ import
tables, macros,
chronicles,
./interpreter/[opcode_values, opcodes_impl, vm_forks, gas_costs, gas_meter, utils/macros_gen_opcodes],
./code_stream,
../vm_types, ../errors, precompiles,
./stack, terminal # Those are only needed for logging
./code_stream, ../vm_types, ../errors, precompiles, ./stack,
terminal # Those are only needed for logging
logScope:
topics = "vm opcode"