Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chnges extra_seed from String to Vec<u8> #75

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions programs/world/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ pub mod world {
}

#[allow(unused_variables)]
pub fn add_entity(ctx: Context<AddEntity>, extra_seed: Option<String>) -> Result<()> {
pub fn add_entity(ctx: Context<AddEntity>, Option<Vec<u8>>) -> Result<()> {
require!(
ctx.accounts.world.key() == ctx.accounts.world.pda().0,
WorldError::WorldAccountMismatch
Expand Down Expand Up @@ -132,7 +132,7 @@ pub struct InitializeNewWorld<'info> {
}

#[derive(Accounts)]
#[instruction(extra_seed: Option<String>)]
#[instruction(extra_seed: Option<Vec<u8>>)]
pub struct AddEntity<'info> {
#[account(mut)]
pub payer: Signer<'info>,
Expand All @@ -142,7 +142,7 @@ pub struct AddEntity<'info> {
None => world.entities.to_be_bytes()
},
match extra_seed {
Some(ref seed) => seed.as_bytes(),
Some(ref seed) => seed,
None => &[],
}], bump)]
pub entity: Account<'info, Entity>,
Expand Down
Loading