File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
cardano-wasm/src-lib/Cardano/Wasm/Api/Certificate Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -47,7 +47,7 @@ import Cardano.Ledger.Api (Delegatee (..))
4747import Cardano.Wasm.ExceptionHandling (rightOrError , throwError , toMonadFail )
4848
4949import Control.Monad.Catch (MonadThrow )
50- import Data.Aeson (FromJSON , (.:) , (.=) )
50+ import Data.Aeson (FromJSON , (.:) , (.:?) , (. =) )
5151import Data.Aeson qualified as Aeson
5252import Data.ByteString.Base16 qualified as Base16
5353import Data.Text (Text )
@@ -94,15 +94,15 @@ instance FromJSON StakeCertificateObject where
9494 toMonadFail $
9595 rightOrError $
9696 Api. deserialiseFromRawBytesHex (Text. encodeUtf8 skHashText)
97- deposit :: Maybe Coin <- o .: " deposit"
97+ deposit :: Maybe Coin <- o .:? " deposit"
9898 actionStr :: Text <- o .: " action"
9999 action <-
100100 case actionStr of
101101 " RegisterStake" -> return RegisterStake
102102 " UnregisterStake" -> return UnregisterStake
103103 " DelegateOnly" -> return DelegateOnly
104104 _ -> toMonadFail $ throwError (" Invalid action for StakeCertificateObject: " ++ show actionStr)
105- delegateStakeText :: Maybe Text <- o .: " delegateStake"
105+ delegateStakeText :: Maybe Text <- o .:? " delegateStake"
106106 delegateStake :: Maybe PoolId <-
107107 traverse
108108 ( toMonadFail
You can’t perform that action at this time.
0 commit comments