mirror of
https://github.com/logos-blockchain/logos-execution-zone.git
synced 2026-05-15 12:39:30 +00:00
fix: move flash swap types before all functions in test module
This commit is contained in:
parent
324593c4c7
commit
5b42d8ed9c
@ -460,25 +460,6 @@ pub mod tests {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn transfer_transaction(
|
|
||||||
from: AccountId,
|
|
||||||
from_key: &PrivateKey,
|
|
||||||
from_nonce: u128,
|
|
||||||
to: AccountId,
|
|
||||||
to_key: &PrivateKey,
|
|
||||||
to_nonce: u128,
|
|
||||||
balance: u128,
|
|
||||||
) -> PublicTransaction {
|
|
||||||
let account_ids = vec![from, to];
|
|
||||||
let nonces = vec![Nonce(from_nonce), Nonce(to_nonce)];
|
|
||||||
let program_id = Program::authenticated_transfer_program().id();
|
|
||||||
let message =
|
|
||||||
public_transaction::Message::try_new(program_id, account_ids, nonces, balance).unwrap();
|
|
||||||
let witness_set =
|
|
||||||
public_transaction::WitnessSet::for_message(&message, &[from_key, to_key]);
|
|
||||||
PublicTransaction::new(message, witness_set)
|
|
||||||
}
|
|
||||||
|
|
||||||
// ── Flash Swap types (mirrors of guest types for host-side serialisation) ──
|
// ── Flash Swap types (mirrors of guest types for host-side serialisation) ──
|
||||||
|
|
||||||
#[derive(serde::Serialize, serde::Deserialize)]
|
#[derive(serde::Serialize, serde::Deserialize)]
|
||||||
@ -510,6 +491,25 @@ pub mod tests {
|
|||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn transfer_transaction(
|
||||||
|
from: AccountId,
|
||||||
|
from_key: &PrivateKey,
|
||||||
|
from_nonce: u128,
|
||||||
|
to: AccountId,
|
||||||
|
to_key: &PrivateKey,
|
||||||
|
to_nonce: u128,
|
||||||
|
balance: u128,
|
||||||
|
) -> PublicTransaction {
|
||||||
|
let account_ids = vec![from, to];
|
||||||
|
let nonces = vec![Nonce(from_nonce), Nonce(to_nonce)];
|
||||||
|
let program_id = Program::authenticated_transfer_program().id();
|
||||||
|
let message =
|
||||||
|
public_transaction::Message::try_new(program_id, account_ids, nonces, balance).unwrap();
|
||||||
|
let witness_set =
|
||||||
|
public_transaction::WitnessSet::for_message(&message, &[from_key, to_key]);
|
||||||
|
PublicTransaction::new(message, witness_set)
|
||||||
|
}
|
||||||
|
|
||||||
fn build_flash_swap_tx(
|
fn build_flash_swap_tx(
|
||||||
initiator: &Program,
|
initiator: &Program,
|
||||||
vault_id: AccountId,
|
vault_id: AccountId,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user