Skip to content

Instantly share code, notes, and snippets.

@FrankC01
Last active April 21, 2025 19:04
Show Gist options
  • Save FrankC01/e06eaf4af5507278bbdcce664d78d88f to your computer and use it in GitHub Desktop.
Save FrankC01/e06eaf4af5507278bbdcce664d78d88f to your computer and use it in GitHub Desktop.
move to bcs - SystemStateInnerV1
"""Move Datatypes shell for BCS generation, DO NOT MODIFY."""
from typing import Any
import json
import canoser
import pysui.sui.sui_types.bcs_stnd as bcse
class EventBlob(canoser.Struct):
"""Generated from 0xfdc88f7d7cf30afab2f82e8380d11ee8f70efb90e863d1de8616fae1bb09ea77::event_blob::EventBlob"""
_fields = [("blob_id", bcse.U256), ("ending_checkpoint_sequence_number", bcse.U64)]
class Entry_EventBlob_u16(canoser.Struct):
"""Generated from 0x0000000000000000000000000000000000000000000000000000000000000002::vec_map::Entry"""
_fields = [("key", EventBlob), ("value", bcse.U16)]
class ID(canoser.Struct):
"""Generated from 0x0000000000000000000000000000000000000000000000000000000000000002::object::ID"""
_fields = [("bytes", bcse.Address)]
class Element_UncompressedG1(canoser.Struct):
"""Generated from 0x0000000000000000000000000000000000000000000000000000000000000002::group_ops::Element"""
_fields = [("bytes", [bcse.U8, None, True])]
class VecMap_EventBlob_u16(canoser.Struct):
"""Generated from 0x0000000000000000000000000000000000000000000000000000000000000002::vec_map::VecMap"""
_fields = [("contents", [Entry_EventBlob_u16, None, True])]
class FutureAccounting(canoser.Struct):
"""Generated from 0xfdc88f7d7cf30afab2f82e8380d11ee8f70efb90e863d1de8616fae1bb09ea77::storage_accounting::FutureAccounting"""
_fields = [
("epoch", bcse.U32),
("used_capacity", bcse.U64),
("rewards_to_distribute", bcse.Balance),
]
class Element_G1(canoser.Struct):
"""Generated from 0x0000000000000000000000000000000000000000000000000000000000000002::group_ops::Element"""
_fields = [("bytes", [bcse.U8, None, True])]
class BlsCommitteeMember(canoser.Struct):
"""Generated from 0xfdc88f7d7cf30afab2f82e8380d11ee8f70efb90e863d1de8616fae1bb09ea77::bls_aggregate::BlsCommitteeMember"""
_fields = [
("public_key", Element_UncompressedG1),
("weight", bcse.U16),
("node_id", ID),
]
class ExtendedField_VecMap(canoser.Struct):
"""Generated from 0xfdc88f7d7cf30afab2f82e8380d11ee8f70efb90e863d1de8616fae1bb09ea77::extended_field::ExtendedField"""
_fields = [("id", bcse.Address)]
class EventBlobCertificationState_optional_latest_certified_blob(canoser.RustOptional):
_type = EventBlob
def to_json(self, sort_keys=False, indent=4):
amap = self.to_json_serializable()
return json.dumps(amap, sort_keys=sort_keys, indent=indent)
class EventBlobCertificationState(canoser.Struct):
"""Generated from 0xfdc88f7d7cf30afab2f82e8380d11ee8f70efb90e863d1de8616fae1bb09ea77::event_blob::EventBlobCertificationState"""
_fields = [
(
"latest_certified_blob",
EventBlobCertificationState_optional_latest_certified_blob,
),
("aggregate_weight_per_blob", VecMap_EventBlob_u16),
]
class FutureAccountingRingBuffer(canoser.Struct):
"""Generated from 0xfdc88f7d7cf30afab2f82e8380d11ee8f70efb90e863d1de8616fae1bb09ea77::storage_accounting::FutureAccountingRingBuffer"""
_fields = [
("current_index", bcse.U32),
("length", bcse.U32),
("ring_buffer", [FutureAccounting, None, True]),
]
class BlsCommittee(canoser.Struct):
"""Generated from 0xfdc88f7d7cf30afab2f82e8380d11ee8f70efb90e863d1de8616fae1bb09ea77::bls_aggregate::BlsCommittee"""
_fields = [
("members", [BlsCommitteeMember, None, True]),
("n_shards", bcse.U16),
("epoch", bcse.U32),
("total_aggregated_key", Element_G1),
]
class SystemStateInnerV1(canoser.Struct):
"""Generated from 0xfdc88f7d7cf30afab2f82e8380d11ee8f70efb90e863d1de8616fae1bb09ea77::system_state_inner::SystemStateInnerV1"""
_fields = [
("committee", BlsCommittee),
("total_capacity_size", bcse.U64),
("used_capacity_size", bcse.U64),
("storage_price_per_unit_size", bcse.U64),
("write_price_per_unit_size", bcse.U64),
("future_accounting", FutureAccountingRingBuffer),
("event_blob_certification_state", EventBlobCertificationState),
("deny_list_sizes", ExtendedField_VecMap),
]
class DynamicField_u64_SystemStateInnerV1(canoser.Struct):
"""Generated from None"""
_fields = [("id", bcse.Address), ("name", bcse.U64), ("value", SystemStateInnerV1)]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment