Skip to content

Commit

Permalink
Update to newest SDK
Browse files Browse the repository at this point in the history
  • Loading branch information
joncinque committed Oct 11, 2024
1 parent a8c1b07 commit 6522595
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 10 deletions.
4 changes: 2 additions & 2 deletions build.zig.zon
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@
.hash = "122062d301a203d003547b414237229b09a7980095061697349f8bef41be9c30266b",
},
.@"solana-program-sdk" = .{
.url = "https://github.com/joncinque/solana-program-sdk-zig/archive/refs/tags/v0.13.1.tar.gz",
.hash = "122030336f1257e3c0aa64243f5243f554b903c6b9ef3a91d48bfbe896c0c7d9b13b",
.url = "https://github.com/joncinque/solana-program-sdk-zig/archive/refs/tags/v0.14.0.tar.gz",
.hash = "1220bdfa4ea1ab6330959ce4bc40feb5b39a7f98923a266a94b69e27fd20c3526786",
},
},

Expand Down
6 changes: 3 additions & 3 deletions program-test/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ version = "0.0.1"

[dev-dependencies]
num_enum = "0.7"
solana-program = "2.0.0"
solana-program-test = "2.0.0"
solana-sdk = "2.0.0"
solana-program = "2.0.3"
solana-program-test = "2.0.3"
solana-sdk = "2.0.3"
test-case = "3"
2 changes: 1 addition & 1 deletion program-test/tests/functional.rs
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ async fn fail_init_uninitialized() {
.unwrap_err();
assert_eq!(
err,
TransactionError::InstructionError(1, InstructionError::Custom(4))
TransactionError::InstructionError(1, InstructionError::Custom(3))
);
}

Expand Down
6 changes: 2 additions & 4 deletions src/main.zig
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,8 @@ const state = @import("state.zig");
const ProgramError = @import("error.zig").ProgramError;

export fn entrypoint(input: [*]u8) u64 {
const context = sol.Context.load(input) catch return 1;
const accounts = context.loadRawAccounts(sol.allocator) catch return 1;
defer accounts.deinit();
processInstruction(context.program_id, accounts.items, context.data) catch |err| return @intFromError(err);
var context = sol.Context.load(input) catch return 1;
processInstruction(context.program_id, context.accounts[0..context.num_accounts], context.data) catch |err| return @intFromError(err);
return 0;
}

Expand Down

0 comments on commit 6522595

Please sign in to comment.