Skip to content

Commit

Permalink
refactor: apply code simplification to break with bool value (n-04) (#…
Browse files Browse the repository at this point in the history
…2639)

* refactor: apply code simplification to break with bool value

* tests: regenerate test db

* fix: update policies

* fix: update policies
  • Loading branch information
glihm authored Nov 9, 2024
1 parent 0bd03bb commit 86c6a6c
Show file tree
Hide file tree
Showing 5 changed files with 42 additions and 46 deletions.
80 changes: 40 additions & 40 deletions bin/sozo/tests/test_data/policies.json
Original file line number Diff line number Diff line change
@@ -1,48 +1,8 @@
[
{
"target": "0x7077c3246c125a91b17e8c0a90f45af790ad6feabe65a3df225277d9eb02310",
"method": "upgrade"
},
{
"target": "0x74967fafd9ea26b0c14287fdafa5867cf6e2d16d9e6fda3dde4361a7cf75c9d",
"method": "upgrade"
},
{
"target": "0x7e2c18814dd45847ae85d3c8eb40196cc2aa869614efd1ff67edf380c45cb8e",
"method": "upgrade"
},
{
"target": "0x7d32611d1b96df37b041f0a285bf340227cebc144d46c2f34cedd81e2fd5239",
"method": "spawn"
},
{
"target": "0x7d32611d1b96df37b041f0a285bf340227cebc144d46c2f34cedd81e2fd5239",
"method": "move"
},
{
"target": "0x7d32611d1b96df37b041f0a285bf340227cebc144d46c2f34cedd81e2fd5239",
"method": "set_player_config"
},
{
"target": "0x7d32611d1b96df37b041f0a285bf340227cebc144d46c2f34cedd81e2fd5239",
"method": "reset_player_config"
},
{
"target": "0x7d32611d1b96df37b041f0a285bf340227cebc144d46c2f34cedd81e2fd5239",
"method": "set_player_server_profile"
},
{
"target": "0x7d32611d1b96df37b041f0a285bf340227cebc144d46c2f34cedd81e2fd5239",
"method": "set_models"
},
{
"target": "0x7d32611d1b96df37b041f0a285bf340227cebc144d46c2f34cedd81e2fd5239",
"method": "enter_dungeon"
},
{
"target": "0x7d32611d1b96df37b041f0a285bf340227cebc144d46c2f34cedd81e2fd5239",
"method": "upgrade"
},
{
"target": "0x54d0f13bf3fb5f15a8674c5204aad35e3022af96bcc23bdbd16b7e297ffd399",
"method": "uuid"
Expand Down Expand Up @@ -127,6 +87,46 @@
"target": "0x54d0f13bf3fb5f15a8674c5204aad35e3022af96bcc23bdbd16b7e297ffd399",
"method": "upgrade"
},
{
"target": "0x7d32611d1b96df37b041f0a285bf340227cebc144d46c2f34cedd81e2fd5239",
"method": "spawn"
},
{
"target": "0x7d32611d1b96df37b041f0a285bf340227cebc144d46c2f34cedd81e2fd5239",
"method": "move"
},
{
"target": "0x7d32611d1b96df37b041f0a285bf340227cebc144d46c2f34cedd81e2fd5239",
"method": "set_player_config"
},
{
"target": "0x7d32611d1b96df37b041f0a285bf340227cebc144d46c2f34cedd81e2fd5239",
"method": "reset_player_config"
},
{
"target": "0x7d32611d1b96df37b041f0a285bf340227cebc144d46c2f34cedd81e2fd5239",
"method": "set_player_server_profile"
},
{
"target": "0x7d32611d1b96df37b041f0a285bf340227cebc144d46c2f34cedd81e2fd5239",
"method": "set_models"
},
{
"target": "0x7d32611d1b96df37b041f0a285bf340227cebc144d46c2f34cedd81e2fd5239",
"method": "enter_dungeon"
},
{
"target": "0x7d32611d1b96df37b041f0a285bf340227cebc144d46c2f34cedd81e2fd5239",
"method": "upgrade"
},
{
"target": "0x7077c3246c125a91b17e8c0a90f45af790ad6feabe65a3df225277d9eb02310",
"method": "upgrade"
},
{
"target": "0x74967fafd9ea26b0c14287fdafa5867cf6e2d16d9e6fda3dde4361a7cf75c9d",
"method": "upgrade"
},
{
"target": "0x2af9427c5a277474c079a1283c880ee8a6f0f8fbf73ce969c08d88befec1bba",
"method": "__declare_transaction__"
Expand Down
6 changes: 1 addition & 5 deletions crates/dojo/core/src/utils/naming.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,7 @@ pub fn is_name_valid(name: @ByteArray) -> bool {
let mut i = 0;
loop {
if i >= name.len() {
if i > 0 {
break true;
} else {
break false;
}
break (i > 0);
}

let c = name.at(i).unwrap();
Expand Down
2 changes: 1 addition & 1 deletion examples/spawn-and-move/dojo_dev.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ rpc_url = "http://localhost:5050/"
# Default account for katana with seed = 0
account_address = "0x2af9427c5a277474c079a1283c880ee8a6f0f8fbf73ce969c08d88befec1bba"
private_key = "0x1800000000300000180000000000030000000000003006001800006600"
world_address = "0x54d0f13bf3fb5f15a8674c5204aad35e3022af96bcc23bdbd16b7e297ffd399"
world_address = "0x70058e3886cb7411e8a77db90ee3dd453ac16b763b30bd99b3c8440fe42056e"

[init_call_args]
"ns-others" = ["0xff"]
Expand Down
Binary file modified spawn-and-move-db.tar.gz
Binary file not shown.
Binary file modified types-test-db.tar.gz
Binary file not shown.

0 comments on commit 86c6a6c

Please sign in to comment.