jam.state.components.chi module

jam.state.components.chi.ChiM

Can alter Delta

jam.state.components.chi.ChiA

Can alter Iota

class jam.state.components.chi.ChiG(initial: Mapping[K, V] | None = None)[source]

Bases: Dictionary[U32, U64]

Dictionary containing indices of services which automatically acc in each block w/ basic gas

static decode_from(buffer: bytes | bytearray | memoryview, offset: int = 0) Tuple[Dictionary[K, V], int]

Decode from buffer. Must be implemented by subclasses or added via decorator.

Parameters:
  • buffer – Buffer to decode from

  • offset – Starting position in buffer

Returns:

  • The decoded value

  • Number of bytes read

Return type:

Tuple containing

key_type

alias of U32

value_type

alias of U64

class jam.state.components.chi.Chi(m: U32, a: U32, v: U32, g: ChiG)[source]

Bases: Codable

Chi state

m: U32
a: U32
__init__(m: U32, a: U32, v: U32, g: ChiG) None

Initialize the Codable.

Parameters:
  • codec – Optional codec to use for encoding/decoding

  • enc_sequence – Optional function that returns sequence of fields to encode

static decode_from(buffer: bytes | bytearray | memoryview, offset: int = 0) Tuple[T, int]

Decode from buffer. Must be implemented by subclasses or added via decorator.

Parameters:
  • buffer – Buffer to decode from

  • offset – Starting position in buffer

Returns:

  • The decoded value

  • Number of bytes read

Return type:

Tuple containing

encode_into(buffer: bytearray, offset: int = 0) int

Encode into provided buffer.

encode_size() int

Calculate number of bytes needed to encode.

v: U32
g: ChiG