| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Morley.Client.Util
Synopsis
- epNameToTezosEp :: EpName -> Text
- extractAddressesFromValue :: Value -> [Address]
- disableAlphanetWarning :: IO ()
- runContract :: forall cp st m. (HasTezosRpc m, ParameterScope cp, StorageScope st) => RunContractParameters cp st -> m (AsRPC (Value st))
- runContractSimple :: forall cp st m. (HasTezosRpc m, ParameterScope cp, StorageScope st) => Contract cp st -> Value cp -> Value st -> Mutez -> m (AsRPC (Value st))
- data RunContractParameters cp st = RunContractParameters {
- rcpContract :: Contract cp st
- rcpParameter :: Value cp
- rcpStorage :: Value st
- rcpBalance :: Mutez
- rcpAmount :: Mutez
- rcpSender :: Maybe Address
- rcpSource :: Maybe Address
- scrubbedBytesToString :: ScrubbedBytes -> String
- readScrubbedBytes :: MonadIO m => m ScrubbedBytes
Documentation
epNameToTezosEp :: EpName -> Text Source #
Convert EpName to the textual representation used by RPC and tezos-client.
extractAddressesFromValue :: Value -> [Address] Source #
Extract all addresses value from given untyped Value.
Note that it returns all values that can be used as an address. However, some of fetched values can never be used as an address.
disableAlphanetWarning :: IO () Source #
Sets the environment variable for disabling tezos-client "not a mainnet" warning
runContract :: forall cp st m. (HasTezosRpc m, ParameterScope cp, StorageScope st) => RunContractParameters cp st -> m (AsRPC (Value st)) Source #
Run contract with given parameter and storage and get new storage without injecting anything to the chain.
Storage type is limited to not have any bigmaps because their updates are treated differently in node RPC and its quite nontrivial to properly support storage update when storage type contains bigmaps.
Arguments
| :: forall cp st m. (HasTezosRpc m, ParameterScope cp, StorageScope st) | |
| => Contract cp st | Contract |
| -> Value cp | Parameter passed to the contract |
| -> Value st | Initial storage |
| -> Mutez | Initial balance |
| -> m (AsRPC (Value st)) |
Simplified version of runContract for convenience
Sets transfer amount to 0 and sender and source are both unspecified.
data RunContractParameters cp st Source #
A structure with all the parameters for runContract
Constructors
| RunContractParameters | |
Fields
| |
scrubbedBytesToString :: ScrubbedBytes -> String Source #
Convert ScrubbedBytes to String, so that it can be passed to tezos-client
as a stdin
readScrubbedBytes :: MonadIO m => m ScrubbedBytes Source #
Function for relatively safe getting password from stdin.
After reading bytes are converted to ScrubbedBytes, thus it's harder
to accidentally leak them.