Skip to content
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion .bun-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.4.4
1.4.5
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2.2.0
with:
bun-version: 1.4.4
bun-version: 1.4.5
- name: Restore Bun cache
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
with:
Expand Down Expand Up @@ -70,7 +70,7 @@ jobs:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2.2.0
with:
bun-version: 1.4.4
bun-version: 1.4.5
- name: Restore Bun cache
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
with:
Expand Down Expand Up @@ -101,7 +101,7 @@ jobs:
cargo-${{ runner.os }}-${{ hashFiles('rust-toolchain.toml') }}-
- name: Install Cargo tools
# Installs the versions pinned in mise.toml, and caches them.
uses: jdx/mise-action@b44d12e7d0d8ee7461bb893e1b1993500433185b # v5.2.7
uses: jdx/mise-action@90f833d396d0cc3674b631d2d225e306476c303a # v5.2.10
- name: Audit dependencies
run: cargo audit
- name: Check formatting
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/mutants.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ jobs:
fetch-depth: 2
- uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2.2.0
with:
bun-version: 1.4.4
bun-version: 1.4.5
- name: Restore Bun cache
uses: actions/cache/restore@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
with:
Expand Down Expand Up @@ -219,7 +219,7 @@ jobs:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2.2.0
with:
bun-version: 1.4.4
bun-version: 1.4.5
- name: Restore Bun cache
uses: actions/cache/restore@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
with:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,13 @@ jobs:
- name: Setup Node.js
uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
with:
node-version: 26.13.0
node-version: 26.13.1
registry-url: https://npm.pkg.github.com
scope: "@timbagame"

- uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2.2.0
with:
bun-version: 1.4.4
bun-version: 1.4.5

- name: Check whether this version is published
id: version
Expand Down
2 changes: 1 addition & 1 deletion .node-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
26.13.0
26.13.1
20 changes: 10 additions & 10 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 5 additions & 5 deletions bun.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 16 additions & 0 deletions crates/timba-protocol/src/events.rs
Original file line number Diff line number Diff line change
Expand Up @@ -625,4 +625,20 @@ mod tests {
];
assert_eq!(get_trusted_program_data(&logs, program), vec![vec![5u8; 12]]);
}

#[test]
fn trusted_program_data_keeps_the_frame_after_a_stray_completion() {
let program = "32Jr4JnXWvqq9GqPQynkooHsszaucUUvZfNLh2hdX2L5";
let other = "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA";
let payload = base64::engine::general_purpose::STANDARD.encode([5u8; 12]);
let logs = vec![
format!("Program {program} invoke [1]"),
// A completion for a program that does not own the top frame
// must not close the frame.
format!("Program {other} success"),
format!("Program data: {payload}"),
format!("Program {program} success"),
];
assert_eq!(get_trusted_program_data(&logs, program), vec![vec![5u8; 12]]);
}
}
42 changes: 42 additions & 0 deletions crates/timba-protocol/src/plans.rs
Original file line number Diff line number Diff line change
Expand Up @@ -468,4 +468,46 @@ mod tests {
assert!(is_wrapped_sol(&NATIVE_MINT));
assert!(!is_wrapped_sol(&TOKEN_PROGRAM_ID));
}

#[test]
fn sol_joins_require_a_positive_stake() {
let adapter = ContractAdapter::new(ContractVersion::V0_3_0, PROGRAM_ID);
let player = Address::parse("9WzDXwBbmkg8ZTbNMqUxvQRAyrZzDsGYdLVL9zYtAWWM").unwrap();
for token_amount in [None, Some(0)] {
let input = GameInstructionInput {
game: Address([9; 32]),
player,
token_mint: NATIVE_MINT,
token_amount,
authority: None,
};
assert_eq!(
adapter.build_join_plan(&input).unwrap_err(),
PlanError::Invalid("SOL joins require a positive stake amount".into()),
"{token_amount:?}"
);
}
}

#[test]
fn create_game_requires_a_32_byte_oracle_commitment() {
let creator = Address::parse("9WzDXwBbmkg8ZTbNMqUxvQRAyrZzDsGYdLVL9zYtAWWM").unwrap();
for random_hash in [vec![], vec![7; 31], vec![7; 33]] {
let input = CreateGameInput {
creator,
token_mint: NATIVE_MINT,
game_type: GameType::Coinflip,
amount: 1,
min_players: 2,
max_players: 2,
timeout_seconds: 60,
random_hash,
oracle_operator: creator,
};
assert_eq!(
build_create_game_plan(&input, ContractVersion::V0_3_0, &PROGRAM_ID).unwrap_err(),
PlanError::Invalid("Oracle commitment must be 32 bytes".into())
);
}
}
}
2 changes: 1 addition & 1 deletion mise.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Tools CI installs. Renovate updates these versions by itself.
[tools]
"cargo:cargo-llvm-cov" = "0.9.1"
"cargo:cargo-audit" = "0.22.2"
"cargo:cargo-audit" = "0.23.0"
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -147,14 +147,14 @@
},
"dependencies": {
"@solana/kit": "8.6.0",
"viem": "2.57.16",
"viem": "2.58.1",
"zod": "4.6.7",
"@solana-program/token": "0.18.0",
"@solana-program/system": "0.16.0"
},
"devDependencies": {
"@codama/nodes-from-anchor": "1.5.6",
"@codama/renderers-js": "2.8.0",
"@codama/renderers-js": "2.9.0",
"@hughescr/stryker-bun-runner": "1.6.0",
"@stryker-mutator/core": "10.1.1",
"@types/bun": "^1.4.4",
Expand All @@ -179,5 +179,5 @@
"registry": "https://npm.pkg.github.com",
"access": "public"
},
"packageManager": "bun@1.4.4"
"packageManager": "bun@1.4.5"
}
2 changes: 1 addition & 1 deletion rust-toolchain.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[toolchain]
channel = "1.99.1"
channel = "1.100.0"
components = ["rustfmt", "clippy", "llvm-tools-preview"]
profile = "minimal"
Loading