-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Renames, delete redundant assertions
- Loading branch information
Showing
19 changed files
with
128 additions
and
331 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 0 additions & 36 deletions
36
programs/lighthouse/program/src/processor/v1/create_cache_account.rs
This file was deleted.
Oops, something went wrong.
36 changes: 36 additions & 0 deletions
36
programs/lighthouse/program/src/processor/v1/create_memory_account.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
use anchor_lang::prelude::*; | ||
use borsh::BorshDeserialize; | ||
|
||
use crate::state::memory::MemoryAccount; | ||
|
||
#[derive(Accounts)] | ||
#[instruction(memory_index: u8, memory_account_size: u64)] | ||
pub struct CreateMemoryAccountV1<'info> { | ||
#[account(mut)] | ||
pub signer: Signer<'info>, | ||
pub system_program: Program<'info, System>, | ||
#[account( | ||
init, | ||
seeds=[ | ||
b"memory".as_ref(), | ||
signer.key.as_ref(), | ||
&[memory_index], | ||
], | ||
bump, | ||
payer=signer, | ||
space= 8 + memory_account_size as usize | ||
)] | ||
pub memory_account: AccountLoader<'info, MemoryAccount>, | ||
pub rent: Sysvar<'info, Rent>, | ||
} | ||
|
||
pub fn create_memory_account<'info>( | ||
ctx: Context<'_, '_, '_, 'info, CreateMemoryAccountV1<'info>>, | ||
_memory_index: u8, | ||
_memory_account_size: u64, | ||
|
||
) -> Result<()> { | ||
let _ = &mut ctx.accounts.memory_account.load_init()?; | ||
|
||
Ok(()) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
pub mod assert; | ||
pub mod assert_expression; | ||
pub mod assert_multi; | ||
pub mod create_cache_account; | ||
pub mod create_memory_account; | ||
pub mod write; | ||
|
||
pub use assert::*; | ||
pub use assert_expression::*; | ||
pub use assert_multi::*; | ||
pub use create_cache_account::*; | ||
pub use create_memory_account::*; | ||
pub use write::*; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...ams/lighthouse/program/src/state/cache.rs → ...ms/lighthouse/program/src/state/memory.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
use anchor_lang::prelude::*; | ||
|
||
#[account(zero_copy)] | ||
pub struct CacheAccount {} | ||
pub struct MemoryAccount {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
pub mod cache; | ||
pub mod memory; | ||
|
||
pub use cache::*; | ||
pub use memory::*; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.