sui_move_natives_latest/object_runtime/
accumulator.rs1use move_core_types::account_address::AccountAddress;
5use sui_types::{TypeTag, base_types::ObjectID, effects::AccumulatorOperation};
6
7#[derive(Debug)]
8pub enum MoveAccumulatorAction {
9 Merge,
10 Split,
11}
12
13impl MoveAccumulatorAction {
14 pub fn into_sui_accumulator_action(self) -> AccumulatorOperation {
15 match self {
16 MoveAccumulatorAction::Merge => AccumulatorOperation::Merge,
17 MoveAccumulatorAction::Split => AccumulatorOperation::Split,
18 }
19 }
20}
21
22#[derive(Debug)]
23pub enum MoveAccumulatorValue {
24 U64(u64),
25 EventRef(u64),
27}
28
29#[derive(Debug)]
30pub struct MoveAccumulatorEvent {
31 pub accumulator_id: ObjectID,
34 pub action: MoveAccumulatorAction,
35 pub target_addr: AccountAddress,
36 pub target_ty: TypeTag,
37 pub value: MoveAccumulatorValue,
38}