@@ -14,7 +14,9 @@ import Data.Aeson (FromJSON, ToJSON, parseJSON, toJSON, object, withObject, (.=)
1414import Data.Aeson.TH (deriveJSON , defaultOptions )
1515import Data.Aeson.Types (Parser )
1616import Data.ByteString (ByteString )
17+ import Data.Hashable (Hashable (.. ))
1718import Data.Text (Text )
19+ import Data.Vector (Vector , toList )
1820import Data.Word (Word64 )
1921
2022import EVM.ABI (encodeAbiValue , AbiValue (.. ), AbiType )
@@ -67,6 +69,16 @@ data Tx = Tx
6769 , delay :: ! (W256 , W256 ) -- ^ (Time, # of blocks since last call)
6870 } deriving (Eq , Ord , Show , Generic )
6971
72+ instance Hashable a => Hashable (Vector a ) where
73+ hashWithSalt s v = s `hashWithSalt` toList v
74+
75+ deriving instance Hashable Tx
76+ deriving instance Hashable TxCall
77+ deriving instance Hashable AbiValue
78+ deriving instance Hashable AbiType
79+ deriving anyclass instance Hashable Addr
80+ deriving anyclass instance Hashable W256
81+
7082deriving instance NFData Tx
7183deriving instance NFData TxCall
7284deriving instance NFData AbiValue
0 commit comments