diff --git a/solana-anchor/programs/icco-contributor/src/lib.rs b/solana-anchor/programs/icco-contributor/src/lib.rs index 2a151094..58438361 100644 --- a/solana-anchor/programs/icco-contributor/src/lib.rs +++ b/solana-anchor/programs/icco-contributor/src/lib.rs @@ -13,23 +13,23 @@ pub mod wormhole; pub mod icco_contributor { use super::*; - pub fn create_config( + pub fn create_contributor( ctx: Context, conductor_chain: u16, conductor_address: Vec, wormhole: Pubkey, token_bridge: Pubkey, ) -> Result<()> { - let config = &mut ctx.accounts.config; + let contributor = &mut ctx.accounts.contributor; // there isn't a solana conductor (yet? bwahaha) require!(conductor_chain != 1u16, ContributorError::InvalidConductor); - config.conductor_chain = conductor_chain; - config.conductor_address = conductor_address.try_into().expect("incorrect byte length"); - config.wormhole = wormhole; - config.token_bridge = token_bridge; - config.bump = *ctx.bumps.get("contributor-config").unwrap(); + contributor.conductor_chain = conductor_chain; + contributor.conductor_address = + conductor_address.try_into().expect("incorrect byte length"); + contributor.wormhole = wormhole; + contributor.token_bridge = token_bridge; Ok(()) } diff --git a/solana-anchor/programs/icco-contributor/src/state/config.rs b/solana-anchor/programs/icco-contributor/src/state/config.rs index e279e4c3..cfed32c0 100644 --- a/solana-anchor/programs/icco-contributor/src/state/config.rs +++ b/solana-anchor/programs/icco-contributor/src/state/config.rs @@ -12,7 +12,6 @@ pub struct Contributor { pub conductor_address: [u8; 32], pub wormhole: Pubkey, // 32 bytes pub token_bridge: Pubkey, // 32 bytes - pub bump: u8, } impl Contributor { @@ -34,14 +33,14 @@ impl Contributor { // validation struct #[derive(Accounts)] pub struct CreateContributor<'info> { - #[account(mut)] - pub owner: Signer<'info>, - #[account( init, payer = owner, space = 8 + Contributor::MAXIMUM_SIZE, )] - pub config: Account<'info, Contributor>, + pub contributor: Account<'info, Contributor>, + + #[account(mut)] + pub owner: Signer<'info>, pub system_program: Program<'info, System>, }