Skip to content

Commit 2bf18c3

Browse files
author
lemastero
committed
merge from develop
2 parents 72d85f4 + b8adef4 commit 2bf18c3

15 files changed

+771
-500
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ project/plugins/project/
55
.ensime
66
.ensime_cache/
77
.bloop
8+
out/
89

910
# IDE folders
1011
.idea/
@@ -20,4 +21,4 @@ metals.sbt
2021
.evm-runner_history
2122

2223
# Nix
23-
result
24+
result

insomnia_workspace.json

Lines changed: 46 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"_type": "export",
33
"__export_format": 4,
4-
"__export_date": "2020-09-16T09:48:00.794Z",
4+
"__export_date": "2020-09-21T12:39:47.334Z",
55
"__export_source": "insomnia.desktop.app:v2020.3.3",
66
"resources": [
77
{
@@ -198,6 +198,50 @@
198198
"parentId": "wrk_097d43914a4d4aea8b6f73f647921182",
199199
"_type": "request_group"
200200
},
201+
{
202+
"_id": "req_0ff71c4f648c4d3782612e9c53179321",
203+
"authentication": {},
204+
"body": {
205+
"mimeType": "application/json",
206+
"text": "{\n\t\"jsonrpc\": \"2.0\",\n \"method\": \"eth_chainId\", \n\t\"params\": [],\n \"id\": 1\n}"
207+
},
208+
"created": 1600691926224,
209+
"description": "",
210+
"headers": [
211+
{
212+
"id": "pair_c33a6ada19dd4aa8b75527639519f427",
213+
"name": "Content-Type",
214+
"value": "application/json"
215+
}
216+
],
217+
"isPrivate": false,
218+
"metaSortKey": -1600691926224,
219+
"method": "POST",
220+
"modified": 1600691932451,
221+
"name": "eth_chainId",
222+
"parameters": [],
223+
"parentId": "fld_a06eb77e183c4727800eb7dc43ceabe1",
224+
"settingDisableRenderRequestBody": false,
225+
"settingEncodeUrl": true,
226+
"settingFollowRedirects": "global",
227+
"settingRebuildPath": true,
228+
"settingSendCookies": true,
229+
"settingStoreCookies": true,
230+
"url": "{{node_url}}",
231+
"_type": "request"
232+
},
233+
{
234+
"_id": "fld_a06eb77e183c4727800eb7dc43ceabe1",
235+
"created": 1552939140291,
236+
"description": "",
237+
"environment": {},
238+
"environmentPropertyOrder": null,
239+
"metaSortKey": -1552939140292,
240+
"modified": 1599825661277,
241+
"name": "Eth",
242+
"parentId": "wrk_097d43914a4d4aea8b6f73f647921182",
243+
"_type": "request_group"
244+
},
201245
{
202246
"_id": "req_b60c1a4f9d604d868910f967c6a070d7",
203247
"authentication": {},
@@ -235,18 +279,6 @@
235279
"url": "{{ node_url }}",
236280
"_type": "request"
237281
},
238-
{
239-
"_id": "fld_a06eb77e183c4727800eb7dc43ceabe1",
240-
"created": 1552939140291,
241-
"description": "",
242-
"environment": {},
243-
"environmentPropertyOrder": null,
244-
"metaSortKey": -1552939140292,
245-
"modified": 1599825661277,
246-
"name": "Eth",
247-
"parentId": "wrk_097d43914a4d4aea8b6f73f647921182",
248-
"_type": "request_group"
249-
},
250282
{
251283
"_id": "req_97fa82439e3e46bfb8ee26400af6215d",
252284
"authentication": {},
@@ -797,4 +829,4 @@
797829
"_type": "environment"
798830
}
799831
]
800-
}
832+
}

src/main/resources/application.conf

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -519,17 +519,6 @@ mantis {
519519
port = 13798
520520
}
521521

522-
logging {
523-
# Flag used to switch logs to the JSON format
524-
json-output = false
525-
526-
# Logs directory
527-
logs-dir = ${mantis.datadir}"/logs"
528-
529-
# Logs filename
530-
logs-file = "mantis"
531-
}
532-
533522
async {
534523
dispatchers {
535524
block-forger {
@@ -596,3 +585,14 @@ validation-context {
596585
}
597586
throughput = 1
598587
}
588+
589+
logging {
590+
# Flag used to switch logs to the JSON format
591+
json-output = false
592+
593+
# Logs directory
594+
logs-dir = ${mantis.datadir}"/logs"
595+
596+
# Logs filename
597+
logs-file = "mantis"
598+
}

src/main/resources/logback.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
55

66
<!--read properties from application.conf-->
77
<newRule pattern="*/load" actionClass="io.iohk.ethereum.utils.LoadFromApplicationConfiguration"/>
8-
<load key="mantis.logging.json-output" as="ASJSON"/>
9-
<load key="mantis.logging.logs-dir" as="LOGSDIR"/>
10-
<load key="mantis.logging.logs-file" as="LOGSFILENAME"/>
8+
<load key="logging.json-output" as="ASJSON"/>
9+
<load key="logging.logs-dir" as="LOGSDIR"/>
10+
<load key="logging.logs-file" as="LOGSFILENAME"/>
1111

1212
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
1313
<encoder>

src/main/scala/io/iohk/ethereum/faucet/FaucetApi.scala

Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -17,18 +17,16 @@ import io.iohk.ethereum.rlp
1717
import io.iohk.ethereum.network.p2p.messages.CommonMessages.SignedTransactions.SignedTransactionEnc
1818
import org.bouncycastle.util.encoders.Hex
1919

20-
class FaucetApi(
21-
rpcClient: RpcClient,
22-
keyStore: KeyStore,
23-
config: FaucetConfig,
24-
clock: Clock = Clock.systemUTC())
25-
extends Logger {
20+
class FaucetApi(rpcClient: RpcClient, keyStore: KeyStore, config: FaucetConfig, clock: Clock = Clock.systemUTC())
21+
extends Logger {
2622

2723
private val latestRequestTimestamps = new LruMap[RemoteAddress, Long](config.latestTimestampCacheSize)
2824

2925
private val wallet = keyStore.unlockAccount(config.walletAddress, config.walletPassword) match {
3026
case Right(w) => w
31-
case Left(err) => throw new RuntimeException(s"Cannot unlock wallet for use in faucet (${config.walletAddress}), because of $err")
27+
case Left(err) =>
28+
log.info("accounts " + keyStore.listAccounts().right.get.mkString(", "))
29+
throw new RuntimeException(s"Cannot unlock wallet for use in faucet (${config.walletAddress}), because of $err")
3230
}
3331

3432
private val corsSettings = CorsSettings.defaultSettings
@@ -67,13 +65,8 @@ class FaucetApi(
6765
}
6866

6967
private def prepareTx(targetAddress: Address, nonce: BigInt): ByteString = {
70-
val transaction = Transaction(
71-
nonce,
72-
config.txGasPrice,
73-
config.txGasLimit,
74-
Some(targetAddress),
75-
config.txValue,
76-
ByteString())
68+
val transaction =
69+
Transaction(nonce, config.txGasPrice, config.txGasLimit, Some(targetAddress), config.txValue, ByteString())
7770

7871
val stx = wallet.signTx(transaction, None)
7972
ByteString(rlp.encode(stx.tx.toRLPEncodable))

src/main/scala/io/iohk/ethereum/jsonrpc/DebugJsonMethodsImplicits.scala

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,14 @@
11
package io.iohk.ethereum.jsonrpc
22

3-
import io.iohk.ethereum.jsonrpc.DebugService.{ ListPeersInfoRequest, ListPeersInfoResponse }
4-
import org.json4s.JsonAST.{ JArray, JString, JValue }
3+
import io.iohk.ethereum.jsonrpc.DebugService.{ListPeersInfoRequest, ListPeersInfoResponse}
4+
import io.iohk.ethereum.jsonrpc.JsonRpcController.{Codec, JsonEncoder}
5+
import io.iohk.ethereum.jsonrpc.JsonRpcController.JsonDecoder.NoParamsDecoder
6+
import org.json4s.JsonAST.{JArray, JString, JValue}
57

68
object DebugJsonMethodsImplicits extends JsonMethodsImplicits {
79

810
implicit val debug_listPeersInfo: Codec[ListPeersInfoRequest, ListPeersInfoResponse] =
9-
new Codec[ListPeersInfoRequest, ListPeersInfoResponse] {
10-
def decodeJson(params: Option[JArray]): Either[JsonRpcError, ListPeersInfoRequest] =
11-
Right(ListPeersInfoRequest())
12-
11+
new NoParamsDecoder(ListPeersInfoRequest()) with JsonEncoder[ListPeersInfoResponse] {
1312
def encodeJson(t: ListPeersInfoResponse): JValue =
1413
JArray(t.peers.map(a => JString(a.toString)))
1514
}

0 commit comments

Comments
 (0)