Safe Haskell | None |
---|---|
Language | Haskell2010 |
Measuring operation size.
When originating a contract or making a transfer, tezos node forms operation which is submitted over network. Size of this operation depends on content of originated contract or transfer parameter resp., and tezos has a hard limit on operation size thus it has to be accounted.
Functions declared in this module allow assessing size of origination or
transfer operation with up to constant precision because it yet accounts only
for Michelson primitives participating in the operation.
Other stuff which affects op size include parameters which user passes to
origination or transfer themselves, for instance, amount of mutez carried
to the contract. ATM we don't have necessary primitives in Haskell to be
able to handle those parameters here, probably waiting for [TM-89].
Currently, we can assess overall transfer size only approximatelly, like
in smallTransferOpSize
.
Synopsis
- newtype OpSize = OpSize {}
- opSizeHardLimit :: OpSize
- smallTransferOpSize :: OpSize
- instrOpSize :: InstrAbstract ExpandedOp -> OpSize
- expandedInstrsOpSize :: [ExpandedOp] -> OpSize
- valueOpSize :: Value -> OpSize
Documentation
Operation size in bytes.
We use newtype wrapper because there are different units of measure (another one is gas, and we don't want to confuse them).
opSizeHardLimit :: OpSize Source #
Maximal operation size allowed by Tezos production nodes.
smallTransferOpSize :: OpSize Source #
Base cost of any transfer of 0 mutez with no extra parameters. (Add 'valueOpSize param' to it to get assessment of actual transfer op size)
expandedInstrsOpSize :: [ExpandedOp] -> OpSize Source #
valueOpSize :: Value -> OpSize Source #