Skip to content

Commit

Permalink
remove named instances (#169)
Browse files Browse the repository at this point in the history
  • Loading branch information
martyall authored Sep 20, 2023
1 parent 0de9b8d commit 2fe4e76
Show file tree
Hide file tree
Showing 4 changed files with 108 additions and 173 deletions.
4 changes: 2 additions & 2 deletions src/Network/Ethereum/Web3/Contract.purs
Original file line number Diff line number Diff line change
Expand Up @@ -80,10 +80,10 @@ class CallMethod (selector :: Symbol) a b where
-> Web3 (Either CallError b)

-- ^ `Web3` wrapped result
instance txmethodAbiEncode :: (Generic a rep, GenericABIEncode rep) => TxMethod s a where
instance (Generic a rep, GenericABIEncode rep) => TxMethod s a where
sendTx = _sendTransaction

instance callmethodAbiEncode :: (Generic a arep, GenericABIEncode arep, Generic b brep, GenericABIDecode brep) => CallMethod s a b where
instance (Generic a arep, GenericABIEncode arep, Generic b brep, GenericABIDecode brep) => CallMethod s a b where
call = _call

_sendTransaction
Expand Down
4 changes: 2 additions & 2 deletions src/Network/Ethereum/Web3/JsonRPC.purs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import Simple.JSON (class ReadForeign, class WriteForeign, readImpl, writeImpl,
class Remote a where
remote_ :: (Provider -> Array Foreign -> Aff Foreign) -> a

instance remoteBase :: (ReadForeign a) => Remote (Web3 a) where
instance ReadForeign a => Remote (Web3 a) where
remote_ f = do
p <- ask
res' <- liftAff $ attempt $ f p mempty
Expand All @@ -40,7 +40,7 @@ instance remoteBase :: (ReadForeign a) => Remote (Web3 a) where
asError :: Web3Error -> Error
asError e = error $ writeJSON e

instance remoteInductive :: (WriteForeign a, Remote b) => Remote (a -> b) where
instance (WriteForeign a, Remote b) => Remote (a -> b) where
remote_ f x = remote_ $ \p args -> f p (writeImpl x : args)

foreign import _sendAsync :: Provider -> Request -> EffectFnAff Foreign
Expand Down
Loading

0 comments on commit 2fe4e76

Please sign in to comment.