0.7.43-E5C
This commit is contained in:
@@ -82,9 +82,9 @@ pub struct RaydiumAmmV4SwapDecoded {
|
||||
#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
|
||||
pub enum RaydiumAmmV4DecodedEvent {
|
||||
/// `initialize2` pool creation-like event.
|
||||
Initialize2Pool(RaydiumAmmV4Initialize2PoolDecoded),
|
||||
Initialize2Pool(std::boxed::Box<RaydiumAmmV4Initialize2PoolDecoded>),
|
||||
/// Swap event decoded from a direct or inner Raydium AMM v4 instruction.
|
||||
Swap(RaydiumAmmV4SwapDecoded),
|
||||
Swap(std::boxed::Box<RaydiumAmmV4SwapDecoded>),
|
||||
}
|
||||
|
||||
/// Raydium AmmV4 decoder.
|
||||
@@ -165,8 +165,9 @@ impl RaydiumAmmV4Decoder {
|
||||
log_messages.as_slice(),
|
||||
);
|
||||
if let Some(initialize_event) = initialize_event {
|
||||
decoded_events
|
||||
.push(crate::RaydiumAmmV4DecodedEvent::Initialize2Pool(initialize_event));
|
||||
decoded_events.push(crate::RaydiumAmmV4DecodedEvent::Initialize2Pool(
|
||||
std::boxed::Box::new(initialize_event),
|
||||
));
|
||||
continue;
|
||||
}
|
||||
}
|
||||
@@ -181,7 +182,8 @@ impl RaydiumAmmV4Decoder {
|
||||
token_balances.as_slice(),
|
||||
);
|
||||
match swap_result {
|
||||
Ok(Some(swap)) => decoded_events.push(crate::RaydiumAmmV4DecodedEvent::Swap(swap)),
|
||||
Ok(Some(swap)) => decoded_events
|
||||
.push(crate::RaydiumAmmV4DecodedEvent::Swap(std::boxed::Box::new(swap))),
|
||||
Ok(None) => {},
|
||||
Err(error) => return Err(error),
|
||||
}
|
||||
@@ -429,8 +431,8 @@ fn extract_transaction_account_keys(
|
||||
let mut account_keys = std::vec::Vec::new();
|
||||
let values = transaction
|
||||
.get("transaction")
|
||||
.and_then(|value| value.get("message"))
|
||||
.and_then(|value| value.get("accountKeys"))
|
||||
.and_then(|value| return value.get("message"))
|
||||
.and_then(|value| return value.get("accountKeys"))
|
||||
.and_then(serde_json::Value::as_array);
|
||||
if let Some(values) = values {
|
||||
let mut index = 0usize;
|
||||
@@ -467,8 +469,8 @@ fn append_loaded_addresses(
|
||||
key: &str,
|
||||
) {
|
||||
let addresses = meta
|
||||
.and_then(|value| value.get("loadedAddresses"))
|
||||
.and_then(|value| value.get(key))
|
||||
.and_then(|value| return value.get("loadedAddresses"))
|
||||
.and_then(|value| return value.get(key))
|
||||
.and_then(serde_json::Value::as_array);
|
||||
let addresses = match addresses {
|
||||
Some(addresses) => addresses,
|
||||
@@ -511,7 +513,9 @@ fn collect_token_balance_side(
|
||||
is_pre: bool,
|
||||
accumulators: &mut std::vec::Vec<TokenBalanceAccumulator>,
|
||||
) {
|
||||
let values = meta.and_then(|value| value.get(key)).and_then(serde_json::Value::as_array);
|
||||
let values = meta
|
||||
.and_then(|value| return value.get(key))
|
||||
.and_then(serde_json::Value::as_array);
|
||||
let values = match values {
|
||||
Some(values) => values,
|
||||
None => return,
|
||||
@@ -525,12 +529,12 @@ fn collect_token_balance_side(
|
||||
let owner = value
|
||||
.get("owner")
|
||||
.and_then(serde_json::Value::as_str)
|
||||
.map(|text| text.to_string());
|
||||
.map(|text| return text.to_string());
|
||||
let amount = value
|
||||
.get("uiTokenAmount")
|
||||
.and_then(|amount| amount.get("amount"))
|
||||
.and_then(|amount| return amount.get("amount"))
|
||||
.and_then(serde_json::Value::as_str)
|
||||
.map(|text| text.to_string());
|
||||
.map(|text| return text.to_string());
|
||||
let account_address = match account_index {
|
||||
Some(account_index) => account_address_by_index(account_keys, account_index),
|
||||
None => None,
|
||||
@@ -652,7 +656,7 @@ fn infer_authority_owned_vault_pair(
|
||||
}
|
||||
if candidates
|
||||
.iter()
|
||||
.any(|candidate: &TokenBalanceRecord| candidate.mint == record.mint)
|
||||
.any(|candidate: &TokenBalanceRecord| return candidate.mint == record.mint)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user