Skip to content

Commit

Permalink
fix eof bugs: reject input where only strict prefix is valid
Browse files Browse the repository at this point in the history
  • Loading branch information
michaeljklein committed Dec 9, 2019
1 parent 7e6c10b commit 4958948
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions package.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ library:
- binary
- lorentz-contracts
- optparse-applicative
- megaparsec

executables:
lorentz-contract:
Expand Down
4 changes: 3 additions & 1 deletion src/Lorentz/Contracts/GenericMultisig/Wrapper.hs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ module Lorentz.Contracts.GenericMultisig.Wrapper where
import Data.Singletons
import qualified Data.Text.Lazy as L
import Data.Constraint hiding (trans)
import Text.Megaparsec (eof)

import Lorentz
import Lorentz.Contracts.ManagedLedger.Types
Expand All @@ -24,6 +25,7 @@ import qualified Michelson.TypeCheck.Types as Ty
import qualified Michelson.Typed.Instr as Instr
import Lorentz.Contracts.SomeContractParam

import Control.Applicative
import Data.Type.Equality
import Text.Show
import Data.Typeable
Expand Down Expand Up @@ -258,7 +260,7 @@ parseTypeCheckValue ::
parseTypeCheckValue =
(>>= either (fail . show) return) $
runTypeCheckIsolated . flip runReaderT def . typeVerifyValue . expandValue <$>
value
(value <* eof)

-- | Make `StorageParamsParser` for some `Contract`,
-- assuming a `BigMap` occurs in the storage type
Expand Down

0 comments on commit 4958948

Please sign in to comment.