Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix a bug not returning entry function id for multisig #417

Merged
merged 1 commit into from
Jun 20, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 20 additions & 18 deletions rust/processor/src/utils/util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -110,24 +110,26 @@ pub fn ensure_not_negative(val: BigDecimal) -> BigDecimal {
pub fn get_entry_function_from_user_request(
user_request: &UserTransactionRequest,
) -> Option<String> {
let entry_function_id_str: String = match &user_request.payload.as_ref().unwrap().payload {
Some(PayloadType::EntryFunctionPayload(payload)) => payload.entry_function_id_str.clone(),
Some(PayloadType::MultisigPayload(payload)) => {
if let Some(payload) = payload.transaction_payload.as_ref() {
match payload.payload.as_ref().unwrap() {
MultisigPayloadType::EntryFunctionPayload(payload) => {
Some(payload.entry_function_id_str.clone())
},
};
}
return None;
},
_ => return None,
};
Some(truncate_str(
&entry_function_id_str,
MAX_ENTRY_FUNCTION_LENGTH,
))
let entry_function_id_str: Option<String> =
match &user_request.payload.as_ref().unwrap().payload {
Some(PayloadType::EntryFunctionPayload(payload)) => {
Some(payload.entry_function_id_str.clone())
},
Some(PayloadType::MultisigPayload(payload)) => {
if let Some(payload) = payload.transaction_payload.as_ref() {
match payload.payload.as_ref().unwrap() {
MultisigPayloadType::EntryFunctionPayload(payload) => {
Some(payload.entry_function_id_str.clone())
},
}
} else {
None
}
},
_ => return None,
};

entry_function_id_str.map(|s| truncate_str(&s, MAX_ENTRY_FUNCTION_LENGTH))
}

pub fn get_payload_type(payload: &TransactionPayload) -> String {
Expand Down
Loading