From f12cac02751e06fd1688e435b7298e60abb2555d Mon Sep 17 00:00:00 2001 From: jangko Date: Mon, 1 Jul 2024 19:30:53 +0700 Subject: [PATCH] Addressing PR review --- nimbus/rpc/server_api.nim | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/nimbus/rpc/server_api.nim b/nimbus/rpc/server_api.nim index e8de250f4..93061ae1f 100644 --- a/nimbus/rpc/server_api.nim +++ b/nimbus/rpc/server_api.nim @@ -19,8 +19,6 @@ import ../beacon/web3_eth_conv, ./rpc_types -{.push raises: [].} - type ServerAPIRef = ref object com: CommonRef @@ -30,9 +28,10 @@ const defaultTag = blockId("latest") func newServerAPI*(c: ForkedChainRef): ServerAPIRef = - new(result) - result.com = c.com - result.chain = c + ServerAPIRef( + com: c.com, + chain: c, + ) proc headerFromTag(api: ServerAPIRef, blockTag: BlockTag): Result[common.BlockHeader, string] = if blockTag.kind == bidAlias: