Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Emulation of run_code
.
Synopsis
- runCode :: RunCodeParameters cp epArg st -> Either (InterpretError Void) ([Operation], Value st)
- data RunCodeParameters cp epArg st = RunCodeParameters {
- rcScript :: Contract cp st
- rcStorage :: Value st
- rcInput :: Value epArg
- rcEntryPoint :: EntrypointCallT cp epArg
- rcAmount :: Mutez
- rcBalance :: Mutez
- rcChainId :: ChainId
- rcNow :: Timestamp
- rcLevel :: Natural
- rcMinBlockTime :: Natural
- rcSource :: L1Address
- rcSender :: L1Address
- rcKnownContracts :: Map ContractAddress ContractState
- rcSelf :: Maybe ContractAddress
- rcDelegate :: Maybe KeyHash
- rcVotingPowers :: VotingPowers
- runCodeParameters :: Contract cp st -> Value st -> EntrypointCallT cp epArg -> Value epArg -> RunCodeParameters cp epArg st
- resolveRunCodeBigMaps :: SingI t => BigMapFinder -> Value -> Either TcError (Value t)
Documentation
runCode :: RunCodeParameters cp epArg st -> Either (InterpretError Void) ([Operation], Value st) Source #
Emulate run_code
RPC endpoint to an extent. Unlike runContract
, runs
the contract through the emulator directly, without doing any operations.
This includes not doing the origination operation, and not applying the
operations produced by the transfer.
data RunCodeParameters cp epArg st Source #
Data required for calling runCode
.
RunCodeParameters | |
|
:: Contract cp st | Contract to run |
-> Value st | Contract storage |
-> EntrypointCallT cp epArg | Entrypoint call specification |
-> Value epArg | Entrypoint argument |
-> RunCodeParameters cp epArg st |
Construct RunCodeParameters
with some reasonable defaults.
Prepare untyped storage and parameter with resolveRunCodeBigMaps
.
Use mkEntrypointCall
or mkDefEntrypointCall
to construct the entrypoint
call specification.
resolveRunCodeBigMaps :: SingI t => BigMapFinder -> Value -> Either TcError (Value t) Source #
Given an untyped value, possibly containing big_map
ids, typecheck it,
resolving ids to the corresponding big_map
s.
BigMapFinder
can be constructed using mkBigMapFinder
.