View Source Kadena.Chainweb.Cut (Kadena v0.17.1)

Cut struct definition.

Link to this section Summary

Link to this section Types

@type chain_id() :: 0..19 | String.t() | atom()
@type error() :: {:error, Keyword.t()}
@type hashes() :: map() | list()
@type height() :: non_neg_integer()
@type id() :: String.t()
@type instance() :: String.t()
@type origin() :: map() | nil
@type result() :: t() | error()
@type t() :: %Kadena.Chainweb.Cut{
  hashes: hashes(),
  height: height(),
  id: id(),
  instance: instance(),
  origin: origin(),
  weight: weight()
}
@type validation() :: {:ok, map() | chain_id()} | error()
@type weight() :: String.t()

Link to this section Functions

Link to this function

add_hash(cut, chain_id, hash)

View Source
@spec add_hash(cut :: t(), chain_id :: chain_id(), hash :: map()) :: result()
Link to this function

remove_hash(cut, chain_id)

View Source
@spec remove_hash(cut :: t(), chain_id :: chain_id()) :: result()
@spec set_hashes(cut :: t(), hashes :: hashes()) :: result()
@spec set_height(cut :: t(), height :: height()) :: result()
@spec set_id(cut :: t(), id :: id()) :: result()
Link to this function

set_instance(cut, instance)

View Source
@spec set_instance(cut :: t(), instance :: instance()) :: result()
@spec set_origin(cut :: t(), origin :: origin()) :: result()
@spec set_weight(cut :: t(), weight :: weight()) :: result()