Skip to content

Commit

Permalink
add arg
Browse files Browse the repository at this point in the history
  • Loading branch information
runtian-zhou committed Nov 18, 2024
1 parent 942d114 commit bf6221c
Show file tree
Hide file tree
Showing 4 changed files with 132 additions and 1,458 deletions.
6 changes: 6 additions & 0 deletions crates/transaction-generator-lib/src/args.rs
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,8 @@ pub enum TransactionTypeArg {
SmartTablePicture1BWith256Change,
SmartTablePicture1MWith1KChangeExceedsLimit,
DeserializeU256,
PermissionedTransfer,
APTTransfer,
}

impl TransactionTypeArg {
Expand Down Expand Up @@ -318,6 +320,10 @@ impl TransactionTypeArg {
})
},
TransactionTypeArg::DeserializeU256 => call_custom_module(EntryPoints::DeserializeU256),
TransactionTypeArg::PermissionedTransfer => {
call_custom_module(EntryPoints::APTPermissionedTransfer)
},
TransactionTypeArg::APTTransfer => call_custom_module(EntryPoints::APTTransfer),
}
}

Expand Down
22 changes: 11 additions & 11 deletions crates/transaction-generator-lib/src/publishing/module_simple.rs
Original file line number Diff line number Diff line change
Expand Up @@ -385,9 +385,10 @@ impl EntryPoints {
},
EntryPoints::IncGlobalMilestoneAggV2 { .. }
| EntryPoints::CreateGlobalMilestoneAggV2 { .. } => "counter_with_milestone",
| EntryPoints::DeserializeU256 => "bcs_stream",
EntryPoints::APTPermissionedTransfer
| EntryPoints::APTTransfer => "permissioned_transfer",
EntryPoints::DeserializeU256 => "bcs_stream",
EntryPoints::APTPermissionedTransfer | EntryPoints::APTTransfer => {
"permissioned_transfer"
},
}
}

Expand Down Expand Up @@ -736,14 +737,12 @@ impl EntryPoints {
bcs::to_bytes(&1u64).unwrap(),
],
),
EntryPoints::APTTransfer => get_payload(
module_id,
ident_str!("transfer").to_owned(),
vec![
EntryPoints::APTTransfer => {
get_payload(module_id, ident_str!("transfer").to_owned(), vec![
bcs::to_bytes(&other.expect("Must provide other")).unwrap(),
bcs::to_bytes(&1u64).unwrap(),
],
)
])
},
}
}

Expand Down Expand Up @@ -851,8 +850,9 @@ impl EntryPoints {
EntryPoints::DeserializeU256 => AutomaticArgs::None,
EntryPoints::IncGlobalMilestoneAggV2 { .. } => AutomaticArgs::None,
EntryPoints::CreateGlobalMilestoneAggV2 { .. } => AutomaticArgs::Signer,
EntryPoints::APTPermissionedTransfer
| EntryPoints::APTTransfer => AutomaticArgs::Signer,
EntryPoints::APTPermissionedTransfer | EntryPoints::APTTransfer => {
AutomaticArgs::Signer
},
}
}
}
Expand Down
Loading

0 comments on commit bf6221c

Please sign in to comment.