diff --git a/etherjar-rpc-json/src/main/java/io/emeraldpay/etherjar/rpc/json/TransactionLogJson.java b/etherjar-rpc-json/src/main/java/io/emeraldpay/etherjar/rpc/json/TransactionLogJson.java index 9b72f187..58fb8000 100644 --- a/etherjar-rpc-json/src/main/java/io/emeraldpay/etherjar/rpc/json/TransactionLogJson.java +++ b/etherjar-rpc-json/src/main/java/io/emeraldpay/etherjar/rpc/json/TransactionLogJson.java @@ -30,8 +30,6 @@ import java.util.List; import java.util.Objects; -@JsonDeserialize(using = TransactionLogJsonDeserializer.class) -@JsonSerialize(using = TransactionLogJsonSerializer.class) public class TransactionLogJson implements TransactionRef, Serializable { /** @@ -42,11 +40,15 @@ public class TransactionLogJson implements TransactionRef, Serializable { /** * log index position in the block. null when its pending log. */ + @JsonDeserialize(using = HexLongDeserializer.class) + @JsonSerialize(using = HexLongSerializer.class) private Long logIndex; /** * transactions index position log was created from. null when its pending log. */ + @JsonDeserialize(using = HexLongDeserializer.class) + @JsonSerialize(using = HexLongSerializer.class) private Long transactionIndex; /** @@ -62,6 +64,8 @@ public class TransactionLogJson implements TransactionRef, Serializable { /** * the block number where this log was in. null when its pending. null when its pending log. */ + @JsonDeserialize(using = HexLongDeserializer.class) + @JsonSerialize(using = HexLongSerializer.class) private Long blockNumber; /** diff --git a/etherjar-rpc-json/src/main/java/io/emeraldpay/etherjar/rpc/json/TransactionLogJsonDeserializer.java b/etherjar-rpc-json/src/main/java/io/emeraldpay/etherjar/rpc/json/TransactionLogJsonDeserializer.java deleted file mode 100644 index 6c1e8271..00000000 --- a/etherjar-rpc-json/src/main/java/io/emeraldpay/etherjar/rpc/json/TransactionLogJsonDeserializer.java +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Copyright (c) 2020 EmeraldPay Inc, All Rights Reserved. - * Copyright (c) 2016-2017 Infinitape Inc, All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package io.emeraldpay.etherjar.rpc.json; - -import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.core.JsonProcessingException; -import com.fasterxml.jackson.databind.DeserializationContext; -import com.fasterxml.jackson.databind.JsonNode; -import io.emeraldpay.etherjar.hex.Hex32; -import io.emeraldpay.etherjar.hex.HexData; - -import java.io.IOException; -import java.util.ArrayList; -import java.util.List; - -public class TransactionLogJsonDeserializer extends EtherJsonDeserializer { - - @Override - public TransactionLogJson deserialize(JsonParser jp, DeserializationContext ctxt) throws IOException, JsonProcessingException { - JsonNode node = jp.readValueAsTree(); - return deserialize(node); - } - - public TransactionLogJson deserialize(JsonNode node) { - TransactionLogJson log = new TransactionLogJson(); - - log.setAddress(getAddress(node, "address")); - log.setBlockHash(getBlockHash(node, "blockHash")); - log.setBlockNumber(getLong(node, "blockNumber")); - log.setData(getData(node, "data")); - log.setLogIndex(getLong(node, "logIndex")); - List topics = new ArrayList<>(); - for (JsonNode topic : node.get("topics")) { - topics.add(Hex32.from(topic.textValue())); - } - log.setTopics(topics); - log.setTransactionHash(getTxHash(node, "transactionHash")); - log.setTransactionIndex(getLong(node, "transactionIndex")); - log.setRemoved(getBoolean(node, "removed")); - - return log; - } -} diff --git a/etherjar-rpc-json/src/main/java/io/emeraldpay/etherjar/rpc/json/TransactionLogJsonSerializer.java b/etherjar-rpc-json/src/main/java/io/emeraldpay/etherjar/rpc/json/TransactionLogJsonSerializer.java deleted file mode 100644 index 2d0871d3..00000000 --- a/etherjar-rpc-json/src/main/java/io/emeraldpay/etherjar/rpc/json/TransactionLogJsonSerializer.java +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Copyright (c) 2021 EmeraldPay Inc, All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package io.emeraldpay.etherjar.rpc.json; - -import com.fasterxml.jackson.core.JsonGenerator; -import com.fasterxml.jackson.databind.SerializerProvider; -import io.emeraldpay.etherjar.hex.HexData; - -import java.io.IOException; - -public class TransactionLogJsonSerializer extends EtherJsonSerializer { - - - @Override - public void serialize(TransactionLogJson value, JsonGenerator gen, SerializerProvider serializers) throws IOException { - gen.writeStartObject(); - writeField(gen, "address", value.getAddress()); - writeField(gen, "blockHash", value.getBlockHash()); - writeField(gen, "blockNumber", value.getBlockNumber()); - writeField(gen, "data", value.getData()); - writeField(gen, "logIndex", value.getLogIndex()); - - gen.writeFieldName("topics"); - gen.writeStartArray(); - if (value.getTopics() != null) { - for (HexData topic : value.getTopics()) { - gen.writeString(topic.toString()); - } - } - gen.writeEndArray(); - - writeField(gen, "transactionHash", value.getHash()); - writeField(gen, "transactionIndex", value.getTransactionIndex()); - writeField(gen, "removed", value.getRemoved()); - gen.writeEndObject(); - } -} diff --git a/etherjar-rpc-json/src/main/java/io/emeraldpay/etherjar/rpc/json/TransactionReceiptJson.java b/etherjar-rpc-json/src/main/java/io/emeraldpay/etherjar/rpc/json/TransactionReceiptJson.java index d6b6a8d8..84ab7371 100644 --- a/etherjar-rpc-json/src/main/java/io/emeraldpay/etherjar/rpc/json/TransactionReceiptJson.java +++ b/etherjar-rpc-json/src/main/java/io/emeraldpay/etherjar/rpc/json/TransactionReceiptJson.java @@ -25,8 +25,6 @@ import java.util.List; import java.util.Objects; -@JsonDeserialize(using = TransactionReceiptJsonDeserializer.class) -@JsonSerialize(using = TransactionReceiptJsonSerializer.class) public class TransactionReceiptJson implements TransactionRef, Serializable { /** @@ -37,6 +35,8 @@ public class TransactionReceiptJson implements TransactionRef, Serializable { /** * position in the block */ + @JsonDeserialize(using = HexLongDeserializer.class) + @JsonSerialize(using = HexLongSerializer.class) private Long transactionIndex; /** @@ -47,11 +47,15 @@ public class TransactionReceiptJson implements TransactionRef, Serializable { /** * block number where this transaction was in */ + @JsonDeserialize(using = HexLongDeserializer.class) + @JsonSerialize(using = HexLongSerializer.class) private Long blockNumber; /** * total amount of gas used when this transaction was executed in the block. */ + @JsonDeserialize(using = HexLongDeserializer.class) + @JsonSerialize(using = HexLongSerializer.class) private Long cumulativeGasUsed; /** @@ -67,6 +71,8 @@ public class TransactionReceiptJson implements TransactionRef, Serializable { /** * amount of gas used by this specific transaction alone. */ + @JsonDeserialize(using = HexLongDeserializer.class) + @JsonSerialize(using = HexLongSerializer.class) private Long gasUsed; /** @@ -82,8 +88,10 @@ public class TransactionReceiptJson implements TransactionRef, Serializable { private Bloom logsBloom; /** - * Optinal tx status. 0 if failed, 1 if successfull + * Optional tx status. 0 if failed, 1 if successfull */ + @JsonDeserialize(using = HexIntDeserializer.class) + @JsonSerialize(using = HexIntSerializer.class) private Integer status; private Wei effectiveGasPrice; @@ -93,7 +101,9 @@ public class TransactionReceiptJson implements TransactionRef, Serializable { * * @see EIP-2718: Typed Transaction Envelope */ - private int type = 0; + @JsonDeserialize(using = HexIntDeserializer.class) + @JsonSerialize(using = HexIntSerializer.class) + private Integer type = 0; public TransactionId getTransactionHash() { return transactionHash; @@ -200,6 +210,9 @@ public void setEffectiveGasPrice(Wei effectiveGasPrice) { } public int getType() { + if (type == null) { + return 0; + } return type; } diff --git a/etherjar-rpc-json/src/main/java/io/emeraldpay/etherjar/rpc/json/TransactionReceiptJsonDeserializer.java b/etherjar-rpc-json/src/main/java/io/emeraldpay/etherjar/rpc/json/TransactionReceiptJsonDeserializer.java deleted file mode 100644 index 7d92e65d..00000000 --- a/etherjar-rpc-json/src/main/java/io/emeraldpay/etherjar/rpc/json/TransactionReceiptJsonDeserializer.java +++ /dev/null @@ -1,75 +0,0 @@ -/* - * Copyright (c) 2020 EmeraldPay Inc, All Rights Reserved. - * Copyright (c) 2016-2017 Infinitape Inc, All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package io.emeraldpay.etherjar.rpc.json; - -import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.core.JsonProcessingException; -import com.fasterxml.jackson.databind.DeserializationContext; -import com.fasterxml.jackson.databind.JsonNode; -import io.emeraldpay.etherjar.domain.Bloom; -import io.emeraldpay.etherjar.hex.HexData; - -import java.io.IOException; -import java.util.ArrayList; -import java.util.List; - -public class TransactionReceiptJsonDeserializer extends EtherJsonDeserializer { - - private TransactionLogJsonDeserializer transactionLogJsonDeserializer = new TransactionLogJsonDeserializer(); - - @Override - public TransactionReceiptJson deserialize(JsonParser jp, DeserializationContext ctxt) - throws IOException, JsonProcessingException { - JsonNode node = jp.readValueAsTree(); - TransactionReceiptJson receipt = new TransactionReceiptJson(); - - receipt.setBlockHash(getBlockHash(node, "blockHash")); - receipt.setBlockNumber(getLong(node, "blockNumber")); - receipt.setContractAddress(getAddress(node, "contractAddress")); - receipt.setFrom(getAddress(node, "from")); - receipt.setTo(getAddress(node, "to")); - receipt.setCumulativeGasUsed(getLong(node, "cumulativeGasUsed")); - receipt.setGasUsed(getLong(node, "gasUsed")); - receipt.setEffectiveGasPrice(getWei(node, "effectiveGasPrice")); - receipt.setTransactionHash(getTxHash(node, "transactionHash")); - receipt.setTransactionIndex(getLong(node, "transactionIndex")); - HexData logsBloom = getData(node, "logsBloom"); - if (logsBloom != null) { - receipt.setLogsBloom(Bloom.from(logsBloom)); - } - - List logs = new ArrayList<>(); - if (node.hasNonNull("logs")) { - for (JsonNode log : node.get("logs")) { - logs.add(transactionLogJsonDeserializer.deserialize(log)); - } - } - receipt.setLogs(logs); - - Integer status = getInt(node, "status"); - if (status != null) { - receipt.setStatus(status); - } - Integer type = getInt(node, "type"); - if (type != null) { - receipt.setType(type); - } - - return receipt; - } -} diff --git a/etherjar-rpc-json/src/main/java/io/emeraldpay/etherjar/rpc/json/TransactionReceiptJsonSerializer.java b/etherjar-rpc-json/src/main/java/io/emeraldpay/etherjar/rpc/json/TransactionReceiptJsonSerializer.java deleted file mode 100644 index 7fb6ebda..00000000 --- a/etherjar-rpc-json/src/main/java/io/emeraldpay/etherjar/rpc/json/TransactionReceiptJsonSerializer.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Copyright (c) 2021 EmeraldPay Inc, All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package io.emeraldpay.etherjar.rpc.json; - -import com.fasterxml.jackson.core.JsonGenerator; -import com.fasterxml.jackson.databind.JsonSerializer; -import com.fasterxml.jackson.databind.SerializerProvider; - -import java.io.IOException; - -public class TransactionReceiptJsonSerializer extends EtherJsonSerializer { - - @Override - public void serialize(TransactionReceiptJson value, JsonGenerator gen, SerializerProvider serializers) throws IOException { - - gen.writeStartObject(); - writeField(gen, "blockHash", value.getBlockHash()); - writeField(gen, "blockNumber", value.getBlockNumber()); - writeField(gen, "contractAddress", value.getContractAddress()); - writeField(gen, "from", value.getFrom()); - writeField(gen, "to", value.getTo()); - writeField(gen, "cumulativeGasUsed", value.getCumulativeGasUsed()); - writeField(gen, "gasUsed", value.getGasUsed()); - writeField(gen, "effectiveGasPrice", value.getEffectiveGasPrice()); - writeField(gen, "transactionHash", value.getTransactionHash()); - writeField(gen, "transactionIndex", value.getTransactionIndex()); - writeField(gen, "logsBloom", value.getLogsBloom()); - - gen.writeFieldName("logs"); - gen.writeStartArray(); - if (value.getLogs() != null) { - JsonSerializer transactionLogJsonSerialized = serializers.findValueSerializer(TransactionLogJson.class); - for (TransactionLogJson logJson : value.getLogs()) { - transactionLogJsonSerialized.serialize(logJson, gen, serializers); - } - } - gen.writeEndArray(); - - if (value.getStatus() != null) { - writeField(gen, "status", value.getStatus()); - } - if (value.getType() != 0) { - writeField(gen, "type", value.getType()); - } - gen.writeEndObject(); - } -} diff --git a/etherjar-rpc-json/src/test/groovy/io/emeraldpay/etherjar/rpc/json/TransactionReceiptJsonSpec.groovy b/etherjar-rpc-json/src/test/groovy/io/emeraldpay/etherjar/rpc/json/TransactionReceiptJsonSpec.groovy index 5efa6223..cb0dbe3e 100644 --- a/etherjar-rpc-json/src/test/groovy/io/emeraldpay/etherjar/rpc/json/TransactionReceiptJsonSpec.groovy +++ b/etherjar-rpc-json/src/test/groovy/io/emeraldpay/etherjar/rpc/json/TransactionReceiptJsonSpec.groovy @@ -22,7 +22,7 @@ import spock.lang.Specification class TransactionReceiptJsonSpec extends Specification { JacksonRpcConverter jacksonRpcConverter = new JacksonRpcConverter() - ObjectMapper objectMapper = new ObjectMapper() + ObjectMapper objectMapper = jacksonRpcConverter.getObjectMapper() def "Parse receipt 0x5929b3"() { @@ -263,4 +263,50 @@ class TransactionReceiptJsonSpec extends Specification { then: receipt.type == 2 } + + def "reads effective gas price 2"() { + setup: + InputStream json = this.class.classLoader.getResourceAsStream("receipt/0x678f2d.json") + + when: + def receipt = jacksonRpcConverter.fromJson(json, TransactionReceiptJson) + + then: + receipt.effectiveGasPrice.toHex() == "0x224e4af38" + } + + def "reads logs"() { + setup: + InputStream json = this.class.classLoader.getResourceAsStream("receipt/0x38b7fb.json") + + when: + def receipt = jacksonRpcConverter.fromJson(json, TransactionReceiptJson) + + then: + receipt.logs.size() == 5 + with(receipt.logs[0]) { + address.toHex() == "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2" + topics.size() == 2 + topics[0].toHex() == "0xe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c" + topics[1].toHex() == "0x0000000000000000000000003fc91a3afd70395cd496c647d5a6cc9d4b2b7fad" + data.toHex() == "0x000000000000000000000000000000000000000000000000008e1bc9bf040000" + blockNumber == 0x12d87b5 + blockHash.toHex() == "0x0fdb9c2f67ab662b05c0569bde0a5b42dbd9ab83d6d074850a8ca62560c69674" + logIndex == 0x341 + transactionIndex == 0xfa + transactionHash.toHex() == "0x38b7fb8b1c10933440bb1ea3068124badf90cb06f504188ef8462a192856d83b" + !removed + } + } + + def "reads bloom"() { + setup: + InputStream json = this.class.classLoader.getResourceAsStream("receipt/0x38b7fb.json") + + when: + def receipt = jacksonRpcConverter.fromJson(json, TransactionReceiptJson) + + then: + receipt.logsBloom.toHex() == "0x00200000000000000000000080000000000000000000000000000000000000000000000000000000000000000000000082000000080000000000000008000000200000080000000000000008000000200000000000000000000000008020000000000000000000100000000000000000400000000000200000000010000000000000000000000000000000000008000000000041000000080000004000000000000000000000000000000000000000000000000200000000000000000000000000000042000000000000800000000000000000000000001000000000000000000000200000000000000000000800000000001000000000400000000000000000" + } } diff --git a/etherjar-rpc-json/src/test/resources/receipt/0x38b7fb.json b/etherjar-rpc-json/src/test/resources/receipt/0x38b7fb.json new file mode 100644 index 00000000..6eb8f0b9 --- /dev/null +++ b/etherjar-rpc-json/src/test/resources/receipt/0x38b7fb.json @@ -0,0 +1,93 @@ +{ + "jsonrpc": "2.0", + "id": 1, + "result": { + "blockHash": "0x0fdb9c2f67ab662b05c0569bde0a5b42dbd9ab83d6d074850a8ca62560c69674", + "blockNumber": "0x12d87b5", + "contractAddress": null, + "cumulativeGasUsed": "0x1b7f2b8", + "effectiveGasPrice": "0x2244cddc9", + "from": "0x25a19272971f6e681f9b1ea682cc3a70f6d10022", + "gasUsed": "0x2c2d2", + "logs": [ + { + "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2", + "topics": [ + "0xe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c", + "0x0000000000000000000000003fc91a3afd70395cd496c647d5a6cc9d4b2b7fad" + ], + "data": "0x000000000000000000000000000000000000000000000000008e1bc9bf040000", + "blockNumber": "0x12d87b5", + "transactionHash": "0x38b7fb8b1c10933440bb1ea3068124badf90cb06f504188ef8462a192856d83b", + "transactionIndex": "0xfa", + "blockHash": "0x0fdb9c2f67ab662b05c0569bde0a5b42dbd9ab83d6d074850a8ca62560c69674", + "logIndex": "0x341", + "removed": false + }, + { + "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2", + "topics": [ + "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", + "0x0000000000000000000000003fc91a3afd70395cd496c647d5a6cc9d4b2b7fad", + "0x000000000000000000000000000089906c37426585e860d02c545ab1d184a6ba" + ], + "data": "0x000000000000000000000000000000000000000000000000008e1bc9bf040000", + "blockNumber": "0x12d87b5", + "transactionHash": "0x38b7fb8b1c10933440bb1ea3068124badf90cb06f504188ef8462a192856d83b", + "transactionIndex": "0xfa", + "blockHash": "0x0fdb9c2f67ab662b05c0569bde0a5b42dbd9ab83d6d074850a8ca62560c69674", + "logIndex": "0x342", + "removed": false + }, + { + "address": "0x722383e1e8994cb8a55cbc1621dc068b62403b1e", + "topics": [ + "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", + "0x000000000000000000000000000089906c37426585e860d02c545ab1d184a6ba", + "0x00000000000000000000000025a19272971f6e681f9b1ea682cc3a70f6d10022" + ], + "data": "0x0000000000000000000000000000000000000000000000618e6f8fe3cdf397a4", + "blockNumber": "0x12d87b5", + "transactionHash": "0x38b7fb8b1c10933440bb1ea3068124badf90cb06f504188ef8462a192856d83b", + "transactionIndex": "0xfa", + "blockHash": "0x0fdb9c2f67ab662b05c0569bde0a5b42dbd9ab83d6d074850a8ca62560c69674", + "logIndex": "0x343", + "removed": false + }, + { + "address": "0x000089906c37426585e860d02c545ab1d184a6ba", + "topics": [ + "0x1c411e9a96e071241c2f21f7726b17ae89e3cab4c78be50e062b03a9fffbbad1" + ], + "data": "0x000000000000000000000000000000000000000000004ff93182cb9d0b937ad70000000000000000000000000000000000000000000000006ee4e18ad804500f", + "blockNumber": "0x12d87b5", + "transactionHash": "0x38b7fb8b1c10933440bb1ea3068124badf90cb06f504188ef8462a192856d83b", + "transactionIndex": "0xfa", + "blockHash": "0x0fdb9c2f67ab662b05c0569bde0a5b42dbd9ab83d6d074850a8ca62560c69674", + "logIndex": "0x344", + "removed": false + }, + { + "address": "0x000089906c37426585e860d02c545ab1d184a6ba", + "topics": [ + "0xd78ad95fa46c994b6551d0da85fc275fe613ce37657fb8d5e3d130840159d822", + "0x0000000000000000000000003fc91a3afd70395cd496c647d5a6cc9d4b2b7fad", + "0x00000000000000000000000025a19272971f6e681f9b1ea682cc3a70f6d10022" + ], + "data": "0x0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008e1bc9bf040000000000000000000000000000000000000000000000000066b0e13925b05eba910000000000000000000000000000000000000000000000000000000000000000", + "blockNumber": "0x12d87b5", + "transactionHash": "0x38b7fb8b1c10933440bb1ea3068124badf90cb06f504188ef8462a192856d83b", + "transactionIndex": "0xfa", + "blockHash": "0x0fdb9c2f67ab662b05c0569bde0a5b42dbd9ab83d6d074850a8ca62560c69674", + "logIndex": "0x345", + "removed": false + } + ], + "logsBloom": "0x00200000000000000000000080000000000000000000000000000000000000000000000000000000000000000000000082000000080000000000000008000000200000080000000000000008000000200000000000000000000000008020000000000000000000100000000000000000400000000000200000000010000000000000000000000000000000000008000000000041000000080000004000000000000000000000000000000000000000000000000200000000000000000000000000000042000000000000800000000000000000000000001000000000000000000000200000000000000000000800000000001000000000400000000000000000", + "status": "0x1", + "to": "0x3fc91a3afd70395cd496c647d5a6cc9d4b2b7fad", + "transactionHash": "0x38b7fb8b1c10933440bb1ea3068124badf90cb06f504188ef8462a192856d83b", + "transactionIndex": "0xfa", + "type": "0x2" + } +} diff --git a/etherjar-rpc-json/src/test/resources/receipt/0x678f2d.json b/etherjar-rpc-json/src/test/resources/receipt/0x678f2d.json new file mode 100644 index 00000000..28c9c919 --- /dev/null +++ b/etherjar-rpc-json/src/test/resources/receipt/0x678f2d.json @@ -0,0 +1,20 @@ +{ + "jsonrpc": "2.0", + "id": 1, + "result": { + "blockHash": "0x0fdb9c2f67ab662b05c0569bde0a5b42dbd9ab83d6d074850a8ca62560c69674", + "blockNumber": "0x12d87b5", + "contractAddress": null, + "cumulativeGasUsed": "0x1b4ddde", + "effectiveGasPrice": "0x224e4af38", + "from": "0x9f48b029a9d5a79fb5f9439e7a6c1ed1d4f89bce", + "gasUsed": "0x5208", + "logs": [], + "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "status": "0x1", + "to": "0xd9f8229e189f905d9cd7de8b9a112f1347a4373c", + "transactionHash": "0x678f2dd342aaafa1254ae207e2641051400029b518386b6380bd6c41162d96c1", + "transactionIndex": "0xf8", + "type": "0x2" + } +}