Skip to content

Commit

Permalink
hints compile in the blockifier
Browse files Browse the repository at this point in the history
  • Loading branch information
gswirski committed Jun 26, 2024
1 parent 8a5902b commit b7a5ae5
Show file tree
Hide file tree
Showing 9 changed files with 174 additions and 169 deletions.
306 changes: 153 additions & 153 deletions Cargo.lock

Large diffs are not rendered by default.

14 changes: 7 additions & 7 deletions crates/katana/cairo/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ version.workspace = true

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

# Use from git instead of crates.io registry so that the workspace patches aren't applied.
# Use a different GitHub fork of Cairo so that the workspace patches aren't applied.
[dependencies]
cairo-lang-casm = { git = "https://github.com/starkware-libs/cairo", tag = "v2.6.3" }
cairo-lang-runner = { git = "https://github.com/starkware-libs/cairo", tag = "v2.6.3" }
cairo-lang-sierra = { git = "https://github.com/starkware-libs/cairo", tag = "v2.6.3" }
cairo-lang-starknet = { git = "https://github.com/starkware-libs/cairo", tag = "v2.6.3" }
cairo-lang-starknet-classes = { git = "https://github.com/starkware-libs/cairo", tag = "v2.6.3" }
cairo-lang-utils = { git = "https://github.com/starkware-libs/cairo", tag = "v2.6.3" }
cairo-lang-casm = { git = "https://github.com/reilabs/cairo", rev = "2203a47f" }
cairo-lang-runner = { git = "https://github.com/reilabs/cairo", rev = "2203a47f" }
cairo-lang-sierra = { git = "https://github.com/reilabs/cairo", rev = "2203a47f" }
cairo-lang-starknet = { git = "https://github.com/reilabs/cairo", rev = "2203a47f" }
cairo-lang-starknet-classes = { git = "https://github.com/reilabs/cairo", rev = "2203a47f" }
cairo-lang-utils = { git = "https://github.com/reilabs/cairo", rev = "2203a47f" }
cairo-vm = "0.9.2"
2 changes: 1 addition & 1 deletion crates/katana/executor/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ tracing.workspace = true
alloy-primitives.workspace = true

# blockifier deps
blockifier = { git = "https://github.com/dojoengine/blockifier", rev = "57c11586", features = [ "testing" ], optional = true }
blockifier = { git = "https://github.com/reilabs/blockifier", branch = "hints", features = [ "testing" ], optional = true }
katana-cairo = { workspace = true, optional = true }

# Disable SIR for now until they support Cairo 2.6.3
Expand Down
2 changes: 1 addition & 1 deletion crates/torii/types-test/Scarb.lock
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ source = "git+https://github.com/dojoengine/dojo?tag=v0.7.2#3da5cad9fdd39b81551e

[[package]]
name = "types_test"
version = "0.7.0"
version = "0.7.2"
dependencies = [
"dojo",
]
2 changes: 1 addition & 1 deletion examples/spawn-and-move/Scarb.lock
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ dependencies = [

[[package]]
name = "dojo_examples"
version = "0.7.1"
version = "0.7.2"
dependencies = [
"dojo",
]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
kind = "DojoContract"
class_hash = "0x3b42f80dc8ac4628b0ed6c89af9055314c0aa2192ea0d9601f262138a1e50c3"
original_class_hash = "0x3b42f80dc8ac4628b0ed6c89af9055314c0aa2192ea0d9601f262138a1e50c3"
class_hash = "0x6b2ada134770a6c936006b38c1f951deee66cbce1892a910377237bda172454"
original_class_hash = "0x6b2ada134770a6c936006b38c1f951deee66cbce1892a910377237bda172454"
base_class_hash = "0x0"
abi = "manifests/dev/abis/base/contracts/dojo_examples_actions_actions.json"
reads = []
Expand Down
4 changes: 2 additions & 2 deletions examples/spawn-and-move/manifests/dev/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -1020,8 +1020,8 @@
{
"kind": "DojoContract",
"address": "0x5c70a663d6b48d8e4c6aaa9572e3735a732ac3765700d470463e670587852af",
"class_hash": "0x3b42f80dc8ac4628b0ed6c89af9055314c0aa2192ea0d9601f262138a1e50c3",
"original_class_hash": "0x3b42f80dc8ac4628b0ed6c89af9055314c0aa2192ea0d9601f262138a1e50c3",
"class_hash": "0x6b2ada134770a6c936006b38c1f951deee66cbce1892a910377237bda172454",
"original_class_hash": "0x6b2ada134770a6c936006b38c1f951deee66cbce1892a910377237bda172454",
"base_class_hash": "0x22f3e55b61d86c2ac5239fa3b3b8761f26b9a5c0b5f61ddbd5d756ced498b46",
"abi": [
{
Expand Down
4 changes: 2 additions & 2 deletions examples/spawn-and-move/manifests/dev/manifest.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ name = "dojo::base::base"
[[contracts]]
kind = "DojoContract"
address = "0x5c70a663d6b48d8e4c6aaa9572e3735a732ac3765700d470463e670587852af"
class_hash = "0x3b42f80dc8ac4628b0ed6c89af9055314c0aa2192ea0d9601f262138a1e50c3"
original_class_hash = "0x3b42f80dc8ac4628b0ed6c89af9055314c0aa2192ea0d9601f262138a1e50c3"
class_hash = "0x6b2ada134770a6c936006b38c1f951deee66cbce1892a910377237bda172454"
original_class_hash = "0x6b2ada134770a6c936006b38c1f951deee66cbce1892a910377237bda172454"
base_class_hash = "0x22f3e55b61d86c2ac5239fa3b3b8761f26b9a5c0b5f61ddbd5d756ced498b46"
abi = "manifests/dev/abis/deployments/contracts/dojo_examples_actions_actions.json"
reads = []
Expand Down
5 changes: 5 additions & 0 deletions examples/spawn-and-move/src/actions.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ mod actions {
use super::IActionsComputed;

use starknet::{ContractAddress, get_caller_address};
use starknet::testing::cheatcode;
use dojo_examples::models::{Position, Moves, Direction, Vec2, PlayerConfig, PlayerItem};
use dojo_examples::utils::next_position;

Expand Down Expand Up @@ -64,6 +65,10 @@ mod actions {
impl ActionsImpl of IActions<ContractState> {
// ContractState is defined by system decorator expansion
fn spawn(ref world: IWorldDispatcher) {
let mut seed: Array<felt252> = ArrayTrait::new();
let mut result: Span<felt252> = cheatcode::<'vrf'>(seed.span());
cheatcode::<'print'>(result);

let player = get_caller_address();
self.set_default_position(player, world);
}
Expand Down

0 comments on commit b7a5ae5

Please sign in to comment.