morley-1.7.0: Developer tools for the Michelson Language
Safe HaskellNone
LanguageHaskell2010

Michelson.OpSize

Description

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

Documentation

newtype OpSize Source #

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).

Constructors

OpSize 

Fields

Instances

Instances details
Eq OpSize Source # 
Instance details

Defined in Michelson.OpSize

Methods

(==) :: OpSize -> OpSize -> Bool #

(/=) :: OpSize -> OpSize -> Bool #

Ord OpSize Source # 
Instance details

Defined in Michelson.OpSize

Show OpSize Source # 
Instance details

Defined in Michelson.OpSize

Semigroup OpSize Source # 
Instance details

Defined in Michelson.OpSize

Monoid OpSize Source # 
Instance details

Defined in Michelson.OpSize

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)