You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
|toInteger (minBound::Word8) <= x && x <=toInteger (maxBound::Word8) ->Byte (fromInteger x)
92
+
|otherwise->error ("Byte "++show hex ++"is not within bounds")
93
+
_ ->error ("Byte "++show hex ++" is not valid hex")
94
+
95
+
fromString num =
96
+
caseR.decimal (T.pack num) of
97
+
Right (x, "")
98
+
|toInteger (minBound::Word8) <= x && x <=toInteger (maxBound::Word8) ->Byte (fromInteger x)
99
+
|otherwise->error ("Byte "++show num ++"is not within bounds")
100
+
_ ->error ("Byte "++show num ++" is not valid decimal")
101
+
102
+
instanceToJSONBytewhere
103
+
toJSON (Byte x) =
104
+
let hexValue =B.toLazyText (B.hexadecimal x)
105
+
in toJSON ("0x"<> hexValue)
106
+
107
+
instanceFromJSONBytewhere
108
+
parseJSON (String v) =
109
+
caseR.hexadecimal v of
110
+
Right (x, "") ->return (Byte x)
111
+
_ ->fail$"Byte "++show v <>" is not valid hex"
112
+
parseJSON _ =fail"Byte should be a JSON String"
113
+
114
+
77
115
--| An object with sync status data.
78
116
dataSyncActive=SyncActive
79
117
{syncStartingBlock::!Quantity
@@ -194,26 +232,40 @@ instance Ord DefaultBlock where
194
232
195
233
--| The Receipt of a Transaction
196
234
dataTxReceipt=TxReceipt
197
-
{receiptTransactionHash::!HexString
235
+
{receiptType::!(MaybeByte)
236
+
--^ BYTE - type of the transaction 0x00 for legacy transactions, 0x01 EIP-2930, 0x02 EIP-1559
237
+
, receiptTransactionHash::!HexString
198
238
--^ DATA, 32 Bytes - hash of the transaction.
199
239
, receiptTransactionIndex::!Quantity
200
240
--^ QUANTITY - index of the transaction.
201
-
, receiptBlockHash::!(MaybeHexString)
202
-
--^ DATA, 32 Bytes - hash of the block where this transaction was in. null when its pending.
203
-
, receiptBlockNumber::!(MaybeQuantity)
204
-
--^ QUANTITY - block number where this transaction was in. null when its pending.
241
+
, receiptBlockHash::!HexString
242
+
--^ DATA, 32 Bytes - hash of the block where this transaction was in.
243
+
, receiptBlockNumber::!Quantity
244
+
--^ QUANTITY - block number where this transaction was in.
245
+
, receiptFrom::!Address
246
+
--^ DATA, 20 Bytes - the address of the sender
247
+
, receiptTo::!(MaybeAddress)
248
+
--^ DATA, 20 Bytes - The address of the receiver. null when the transaction is a contract creation transaction.
205
249
, receiptCumulativeGasUsed::!Quantity
206
250
--^ QUANTITY - The total amount of gas used when this transaction was executed in the block.
207
251
, receiptGasUsed::!Quantity
208
252
--^ QUANTITY - The amount of gas used by this specific transaction alone.
253
+
, receiptBlobGasUsed::!(MaybeQuantity)
254
+
--^ QUANTITY - The amount of blob gas used for this specific transaction. Only specified for blob transactions as defined by EIP-4844.
209
255
, receiptContractAddress::!(MaybeAddress)
210
256
--^ DATA, 20 Bytes - The contract address created, if the transaction was a contract creation, otherwise null.
211
257
, receiptLogs::![Change]
212
258
--^ Array - Array of log objects, which this transaction generated.
213
259
, receiptLogsBloom::!HexString
214
260
--^ DATA, 256 Bytes - Bloom filter for light clients to quickly retrieve related logs.
261
+
, receiptRoot::!(MaybeHexString)
262
+
--^ DATA, 32 Bytes - The post-transaction state root. Only specified for transactions included before the Byzantium upgrade.
215
263
, receiptStatus::!(MaybeQuantity)
216
264
--^ QUANTITY either 1 (success) or 0 (failure)
265
+
, receiptEffectiveGasPrice::!Quantity
266
+
--^ QUANTITY - The actual value per gas deducted from the sender's account. Before EIP-1559, this is equal to the transaction's gas price. After, it is equal to baseFeePerGas + min(maxFeePerGas - baseFeePerGas, maxPriorityFeePerGas).
267
+
, blobGasPrice::!(MaybeQuantity)
268
+
--^ QUANTITY - The actual value per gas deducted from the sender's account for blob gas. Only specified for blob transactions as defined by EIP-4844.
0 commit comments