Skip to content

Commit 8305a3b

Browse files
committed
realloc/steel - add api
1 parent 4db3a63 commit 8305a3b

File tree

9 files changed

+38
-12
lines changed

9 files changed

+38
-12
lines changed

basics/realloc/steel/Cargo.toml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
11
[workspace]
2-
members = ["program"]
2+
members = ["api","program"]
33
resolver = "2"
4+
5+
[workspace.dependencies]
6+
solana-program = "1.18.17"
7+
steel = "2.1"
8+
bytemuck = "1.14"
9+
num_enum = "0.7"
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
[package]
2+
name = "realloc-steel-api"
3+
version = "0.1.0"
4+
edition = "2021"
5+
6+
[lib]
7+
crate-type = ["cdylib", "lib"]
8+
9+
[dependencies]
10+
solana-program.workspace = true
11+
steel.workspace = true
12+
bytemuck.workspace = true
13+
num_enum.workspace = true
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
mod instruction;
2+
mod state;
3+
4+
use steel::*;
5+
6+
declare_id!("z7msBPQHDJjTvdQRoEcKyENgXDhSRYeHieN1ZMTqo35");
7+
8+
pub mod prelude {
9+
pub use crate::instruction::*;
10+
pub use crate::state::*;
11+
}
File renamed without changes.

basics/realloc/steel/program/Cargo.toml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ edition = "2021"
77
crate-type = ["cdylib", "lib"]
88

99
[dependencies]
10-
solana-program = "1.18.17"
11-
steel = "2.1"
12-
bytemuck = "1.14"
13-
num_enum = "0.7"
10+
solana-program.workspace = true
11+
steel.workspace = true
12+
bytemuck.workspace = true
13+
num_enum.workspace = true
14+
realloc-steel-api = {path = "../api"}

basics/realloc/steel/program/src/lib.rs

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,14 @@
1-
mod instructions;
2-
mod state;
3-
4-
use instructions::*;
1+
use realloc_steel_api::prelude::*;
52
use steel::*;
63

7-
declare_id!("z7msBPQHDJjTvdQRoEcKyENgXDhSRYeHieN1ZMTqo35");
8-
94
entrypoint!(process_instruction);
105

116
pub fn process_instruction(
127
program_id: &Pubkey,
138
accounts: &[AccountInfo],
149
data: &[u8],
1510
) -> ProgramResult {
16-
let (ix, data) = parse_instruction(&crate::ID, program_id, data)?;
11+
let (ix, data) = parse_instruction(&realloc_steel_api::ID, program_id, data)?;
1712

1813
match ix {
1914
SteelInstruction::CreateAddressInfo => CreateAddressInfo::process(accounts, data),

0 commit comments

Comments
 (0)