Skip to content
Permalink
Browse files

fixup! WIP: Export Schemas to IOTS.

  • Loading branch information...
krisajenkins committed Jul 11, 2019
1 parent aa49185 commit ecebe977c22f0d1b6987a9ff3f4944af9b1f483a
Showing with 10 additions and 10 deletions.
  1. +4 −4 pkgs/default.nix
  2. +6 −6 plutus-playground-client/src/Types.purs

Some generated files are not rendered by default. Learn more.

@@ -390,7 +390,12 @@ instance encodeSimpleArgument :: Encode SimpleArgument where
instance decodeSimpleArgument :: Decode SimpleArgument where
decode value = genericDecode defaultJsonOptions value

toArgument :: Value -> DataType -> SimpleArgument
toArgument ::
Warn (Text "SimpleHex support.")
Warn (Text "SimpleArray support.")
Warn (Text "SimpleMaybe support.")
Warn (Text "SimpleTuple support.")
=> Value -> DataType -> SimpleArgument
toArgument initialValue = rec
where
rec :: DataType -> SimpleArgument
@@ -403,11 +408,6 @@ toArgument initialValue = rec
| DataType typeSignature [ Record _ fields ] <- dataType = SimpleObject $ over (traversed <<< _Newtype <<< _2) rec fields
| otherwise = Unknowable { context: show initialValue, description: show dataType }

-- rec SimpleHexSchema = SimpleHex Nothing
-- rec (SimpleArraySchema field) = SimpleArray field []
-- rec (SimpleMaybeSchema field) = SimpleMaybe field Nothing
-- rec (SimpleTupleSchema (JsonTuple (fieldA /\ fieldB))) = SimpleTuple (JsonTuple (rec fieldA /\ rec fieldB))

-- | This should just be `map` but we can't put an orphan instance on FunctionSchema. :-(
toArgumentLevel :: Value -> FunctionSchema DataType -> FunctionSchema SimpleArgument
toArgumentLevel initialValue = over (_Newtype <<< _argumentSchema <<< traversed) (toArgument initialValue)

0 comments on commit ecebe97

Please sign in to comment.
You can’t perform that action at this time.