Kaynağa Gözat

oh thank god

Jayant Krishnamurthy 2 yıl önce
ebeveyn
işleme
ba7cac1363

+ 2 - 2
target_chains/solana/programs/solana-receiver/src/lib.rs

@@ -50,7 +50,7 @@ pub mod pyth_solana_receiver {
         Ok(())
     }
 
-    pub fn update(ctx: Context<UpdatePrice>, data: Vec<u8>) -> Result<()> {
+    pub fn update(ctx: Context<Update>, data: Vec<u8>) -> Result<()> {
         // FIXME: more security checks
         // ctx.accounts.guardian_set.index == vaa_data.index;
 
@@ -103,7 +103,7 @@ impl crate::accounts::DecodePostedVaa {
 }
 
 #[derive(Accounts)]
-pub struct UpdatePrice<'info> {
+pub struct Update<'info> {
     #[account(mut)]
     pub payer:          Signer<'info>,
 }

+ 2 - 1
target_chains/solana/programs/solana-receiver/src/tests/test_update_price.rs

@@ -4,6 +4,7 @@ use {
         pubkey::Pubkey,
         instruction::Instruction,
     },
+    solana_sdk::signature::Signer,
     crate::instruction as receiver_instruction,
     crate::accounts as receiver_accounts,
 };
@@ -24,7 +25,7 @@ async fn test_add_price() {
 
     let mut sim = PythSimulator::new().await;
 
-    let accounts = receiver_accounts::Update::populate(&sim.genesis_keypair.pubkey()).to_account_metas(None);
+    let accounts = receiver_accounts::Update { payer: sim.genesis_keypair.pubkey() }.to_account_metas(None);
 
     let inst = Instruction::new_with_bytes(sim.program_id, &(receiver_instruction::Update { data: vec![] }.data()), accounts);