mirror of
https://github.com/logos-blockchain/lssa.git
synced 2026-06-02 07:09:29 +00:00
chore(faucet): add genesis prefix to instruction names
This commit is contained in:
parent
0a7cdb1971
commit
d86e02139f
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -420,7 +420,7 @@ async fn cannot_execute_faucet_program() -> Result<()> {
|
||||
Program::faucet().id(),
|
||||
vec![faucet_account_id, recipient_vault_id],
|
||||
vec![],
|
||||
faucet_core::Instruction::TransferVault {
|
||||
faucet_core::Instruction::GenesisTransferVault {
|
||||
vault_program_id,
|
||||
recipient_id: recipient,
|
||||
amount,
|
||||
|
||||
@ -32,7 +32,7 @@ fn main() {
|
||||
let post_states = unchanged_post_states(&pre_states_clone);
|
||||
|
||||
let chained_calls = match instruction {
|
||||
Instruction::TransferVault {
|
||||
Instruction::GenesisTransferVault {
|
||||
vault_program_id,
|
||||
recipient_id,
|
||||
amount,
|
||||
@ -62,7 +62,7 @@ fn main() {
|
||||
.with_pda_seeds(vec![faucet_core::compute_faucet_seed()]),
|
||||
]
|
||||
}
|
||||
Instruction::TransferDirect { amount } => {
|
||||
Instruction::GenesisTransferDirect { amount } => {
|
||||
let [faucet, recipient] = pre_states
|
||||
.try_into()
|
||||
.expect("TransferDirect requires exactly 2 accounts");
|
||||
|
||||
@ -8,10 +8,12 @@ const FAUCET_SEED_DOMAIN_SEPARATOR: [u8; 32] = *b"/LEZ/v0.3/FaucetSeed/000000000
|
||||
pub enum Instruction {
|
||||
/// Transfers native tokens from system faucet to recipient's vault.
|
||||
///
|
||||
/// Executed only in genesis block by sequencer it-self. User transactions will be denied.
|
||||
///
|
||||
/// Required accounts (2):
|
||||
/// - Faucet PDA account
|
||||
/// - Recipient vault PDA account
|
||||
TransferVault {
|
||||
GenesisTransferVault {
|
||||
vault_program_id: ProgramId,
|
||||
recipient_id: AccountId,
|
||||
amount: u128,
|
||||
@ -19,10 +21,12 @@ pub enum Instruction {
|
||||
|
||||
/// Transfers native tokens from system faucet directly to a recipient account.
|
||||
///
|
||||
/// Executed only in genesis block by sequencer it-self. User transactions will be denied.
|
||||
///
|
||||
/// Required accounts (2):
|
||||
/// - Faucet PDA account
|
||||
/// - Recipient account
|
||||
TransferDirect { amount: u128 },
|
||||
GenesisTransferDirect { amount: u128 },
|
||||
}
|
||||
|
||||
#[must_use]
|
||||
|
||||
@ -457,7 +457,7 @@ fn build_supply_account_genesis_transaction(
|
||||
faucet_program_id,
|
||||
vec![nssa::system_faucet_account_id(), recipient_vault_id],
|
||||
vec![],
|
||||
faucet_core::Instruction::TransferVault {
|
||||
faucet_core::Instruction::GenesisTransferVault {
|
||||
vault_program_id,
|
||||
recipient_id: *account_id,
|
||||
amount: balance,
|
||||
@ -477,7 +477,7 @@ fn build_supply_bridge_account_genesis_transaction(balance: u128) -> PublicTrans
|
||||
faucet_program_id,
|
||||
vec![nssa::system_faucet_account_id(), bridge_account_id],
|
||||
vec![],
|
||||
faucet_core::Instruction::TransferDirect { amount: balance },
|
||||
faucet_core::Instruction::GenesisTransferDirect { amount: balance },
|
||||
)
|
||||
.expect("Failed to serialize bridge genesis transfer instruction");
|
||||
let witness_set = nssa::public_transaction::WitnessSet::from_raw_parts(vec![]);
|
||||
|
||||
@ -30,7 +30,7 @@ fn main() {
|
||||
|
||||
let chained_calls = vec![ChainedCall {
|
||||
program_id: faucet_program_id,
|
||||
instruction_data: to_vec(&faucet_core::Instruction::TransferVault {
|
||||
instruction_data: to_vec(&faucet_core::Instruction::GenesisTransferVault {
|
||||
vault_program_id,
|
||||
recipient_id,
|
||||
amount,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user