-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
.anchor/ | ||
/target | ||
**/.DS_Store | ||
node_modules/ | ||
test-ledger/ |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
[package] | ||
name = "callable-test-2" | ||
version = "0.1.0" | ||
description = "Created with Anchor" | ||
edition = "2021" | ||
|
||
[lib] | ||
crate-type = ["cdylib", "lib"] | ||
name = "callable_test_2" | ||
|
||
[features] | ||
default = [] | ||
cpi = ["no-entrypoint"] | ||
no-entrypoint = [] | ||
no-idl = [] | ||
no-log-ix-name = [] | ||
idl-build = ["anchor-lang/idl-build"] | ||
|
||
[dependencies] | ||
anchor-lang = "0.30.0" |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
[target.bpfel-unknown-unknown.dependencies.std] | ||
features = [] |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
use anchor_lang::prelude::*; | ||
|
||
declare_id!("B7apRShjWeCk2j64MFurBzjpnh5YYuNieMVkMZA7joVv"); | ||
|
||
// NOTE: will be removed, wanted to check if discriminator for on_call will be the same | ||
#[program] | ||
pub mod callable_test_2 { | ||
use super::*; | ||
|
||
pub fn on_call(ctx: Context<OnCall>, sender: Pubkey, data: Vec<u8>) -> Result<()> { | ||
Check warning on line 10 in programs/callable-test-2/src/lib.rs GitHub Actions / clippy[clippy] programs/callable-test-2/src/lib.rs#L10
Raw output
Check warning on line 10 in programs/callable-test-2/src/lib.rs GitHub Actions / clippy[clippy] programs/callable-test-2/src/lib.rs#L10
Raw output
Check warning on line 10 in programs/callable-test-2/src/lib.rs GitHub Actions / clippy[clippy] programs/callable-test-2/src/lib.rs#L10
Raw output
|
||
|
||
Ok(()) | ||
} | ||
} | ||
|
||
#[derive(Accounts)] | ||
pub struct Initialize {} | ||
|
||
#[derive(Accounts)] | ||
pub struct OnCall {} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
[package] | ||
name = "callable-test" | ||
version = "0.1.0" | ||
description = "Created with Anchor" | ||
edition = "2021" | ||
|
||
[lib] | ||
crate-type = ["cdylib", "lib"] | ||
name = "callable_test" | ||
|
||
[features] | ||
default = [] | ||
cpi = ["no-entrypoint"] | ||
no-entrypoint = [] | ||
no-idl = [] | ||
no-log-ix-name = [] | ||
idl-build = ["anchor-lang/idl-build"] | ||
|
||
[dependencies] | ||
anchor-lang = { version = "=0.30.0" } |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
[target.bpfel-unknown-unknown.dependencies.std] | ||
features = [] |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
use anchor_lang::prelude::*; | ||
|
||
declare_id!("HhLWiKkriQSSZmu1Pfa2tkQD87HosDSFUqeuZKeEc88m"); | ||
|
||
#[program] | ||
pub mod callable_test { | ||
use super::*; | ||
|
||
pub fn on_call(ctx: Context<OnCall>, sender: Pubkey, data: Vec<u8>) -> Result<()> { | ||
Check warning on line 9 in programs/callable-test/src/lib.rs GitHub Actions / clippy[clippy] programs/callable-test/src/lib.rs#L9
Raw output
Check warning on line 9 in programs/callable-test/src/lib.rs GitHub Actions / clippy[clippy] programs/callable-test/src/lib.rs#L9
Raw output
Check warning on line 9 in programs/callable-test/src/lib.rs GitHub Actions / clippy[clippy] programs/callable-test/src/lib.rs#L9
Raw output
|
||
// Perform custom logic here based on the received data | ||
|
||
Ok(()) | ||
} | ||
} | ||
|
||
#[derive(Accounts)] | ||
pub struct OnCall {} | ||
|
||
|
||
#[account] | ||
pub struct StorageAccount { | ||
pub last_sender: Pubkey, | ||
pub last_data: Vec<u8>, // Store the last used data | ||
} |