25
25
import java .util .List ;
26
26
import java .util .Objects ;
27
27
28
- @ JsonDeserialize (using = TransactionReceiptJsonDeserializer .class )
29
- @ JsonSerialize (using = TransactionReceiptJsonSerializer .class )
30
28
public class TransactionReceiptJson implements TransactionRef , Serializable {
31
29
32
30
/**
@@ -37,6 +35,8 @@ public class TransactionReceiptJson implements TransactionRef, Serializable {
37
35
/**
38
36
* position in the block
39
37
*/
38
+ @ JsonDeserialize (using = HexLongDeserializer .class )
39
+ @ JsonSerialize (using = HexLongSerializer .class )
40
40
private Long transactionIndex ;
41
41
42
42
/**
@@ -47,11 +47,15 @@ public class TransactionReceiptJson implements TransactionRef, Serializable {
47
47
/**
48
48
* block number where this transaction was in
49
49
*/
50
+ @ JsonDeserialize (using = HexLongDeserializer .class )
51
+ @ JsonSerialize (using = HexLongSerializer .class )
50
52
private Long blockNumber ;
51
53
52
54
/**
53
55
* total amount of gas used when this transaction was executed in the block.
54
56
*/
57
+ @ JsonDeserialize (using = HexLongDeserializer .class )
58
+ @ JsonSerialize (using = HexLongSerializer .class )
55
59
private Long cumulativeGasUsed ;
56
60
57
61
/**
@@ -67,6 +71,8 @@ public class TransactionReceiptJson implements TransactionRef, Serializable {
67
71
/**
68
72
* amount of gas used by this specific transaction alone.
69
73
*/
74
+ @ JsonDeserialize (using = HexLongDeserializer .class )
75
+ @ JsonSerialize (using = HexLongSerializer .class )
70
76
private Long gasUsed ;
71
77
72
78
/**
@@ -82,8 +88,10 @@ public class TransactionReceiptJson implements TransactionRef, Serializable {
82
88
private Bloom logsBloom ;
83
89
84
90
/**
85
- * Optinal tx status. 0 if failed, 1 if successfull
91
+ * Optional tx status. 0 if failed, 1 if successfull
86
92
*/
93
+ @ JsonDeserialize (using = HexIntDeserializer .class )
94
+ @ JsonSerialize (using = HexIntSerializer .class )
87
95
private Integer status ;
88
96
89
97
private Wei effectiveGasPrice ;
@@ -93,7 +101,9 @@ public class TransactionReceiptJson implements TransactionRef, Serializable {
93
101
*
94
102
* @see <a href="https://eips.ethereum.org/EIPS/eip-2718">EIP-2718: Typed Transaction Envelope</a>
95
103
*/
96
- private int type = 0 ;
104
+ @ JsonDeserialize (using = HexIntDeserializer .class )
105
+ @ JsonSerialize (using = HexIntSerializer .class )
106
+ private Integer type = 0 ;
97
107
98
108
public TransactionId getTransactionHash () {
99
109
return transactionHash ;
@@ -200,6 +210,9 @@ public void setEffectiveGasPrice(Wei effectiveGasPrice) {
200
210
}
201
211
202
212
public int getType () {
213
+ if (type == null ) {
214
+ return 0 ;
215
+ }
203
216
return type ;
204
217
}
205
218
0 commit comments