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 26, 2024
1 parent dec4cae commit 86580da
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 11 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 @@ -74,6 +74,8 @@ pub enum TransactionTypeArg {
SmartTablePicture1MWith1KChangeExceedsLimit,
DeserializeU256,
SimpleScript,
PermissionedTransfer,
APTTransfer,
}

impl TransactionTypeArg {
Expand Down Expand Up @@ -326,6 +328,10 @@ impl TransactionTypeArg {
},
TransactionTypeArg::DeserializeU256 => call_custom_module(EntryPoints::DeserializeU256),
TransactionTypeArg::SimpleScript => call_custom_module(EntryPoints::SimpleScript),
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 @@ -396,9 +396,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 @@ -759,14 +760,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 @@ -877,8 +876,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

0 comments on commit 86580da

Please sign in to comment.