Skip to content

Commit

Permalink
feat: check models and events upgradability (#2626)
Browse files Browse the repository at this point in the history
  • Loading branch information
remybar authored Nov 5, 2024
1 parent f3276c3 commit 8b2d976
Show file tree
Hide file tree
Showing 49 changed files with 1,853 additions and 986 deletions.
49 changes: 30 additions & 19 deletions Cargo.lock

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

8 changes: 4 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -192,10 +192,10 @@ rpassword = "7.2.0"
rstest = "0.18.2"
rstest_reuse = "0.6.0"
salsa = "0.16.1"
scarb = { git = "https://github.com/dojoengine/scarb", branch = "dojo-284" }
scarb-ui = { git = "https://github.com/dojoengine/scarb", branch = "dojo-284" }
#scarb = { path = "/Users/glihm/swm/scarb/scarb" }
#scarb-ui = { path = "/Users/glihm/swm/scarb/utils/scarb-ui" }
scarb = { git = "https://github.com/remybar/scarb", rev = "fbad7d8d6bdb763b413055d8d9f8b7995672f145" }
scarb-ui = { git = "https://github.com/remybar/scarb", rev = "fbad7d8d6bdb763b413055d8d9f8b7995672f145" }
#scarb = { git = "https://github.com/dojoengine/scarb", branch = "dojo-284" }
#scarb-ui = { git = "https://github.com/dojoengine/scarb", branch = "dojo-284" }
semver = "1.0.5"
serde = { version = "1.0", features = [ "derive" ] }
serde_json = { version = "1.0", features = [ "arbitrary_precision" ] }
Expand Down
1 change: 0 additions & 1 deletion bin/sozo/src/commands/inspect.rs
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,6 @@ fn inspect_resource(resource_name_or_tag: &str, world_diff: &WorldDiff) {
} else {
naming::compute_bytearray_hash(resource_name_or_tag)
};

let resource_diff = world_diff.resources.get(&selector);

if resource_diff.is_none() {
Expand Down
72 changes: 36 additions & 36 deletions bin/sozo/tests/test_data/policies.json
Original file line number Diff line number Diff line change
@@ -1,130 +1,130 @@
[
{
"target": "0x7d7d295e7cab07d4a38f007b1c23717794352097c72cfb0885313fdff56eccb",
"target": "0x7077c3246c125a91b17e8c0a90f45af790ad6feabe65a3df225277d9eb02310",
"method": "upgrade"
},
{
"target": "0x2dfa01b63d923a818cd4b7fe40675638ca3df7e9abfd20cb7bc100dfef3a645",
"target": "0x74967fafd9ea26b0c14287fdafa5867cf6e2d16d9e6fda3dde4361a7cf75c9d",
"method": "upgrade"
},
{
"target": "0x77193b3008464a6db19a02e329d847a1f0e5041c7ca9d2abe145e95402879b7",
"target": "0x7e2c18814dd45847ae85d3c8eb40196cc2aa869614efd1ff67edf380c45cb8e",
"method": "upgrade"
},
{
"target": "0x7d32611d1b96df37b041f0a285bf340227cebc144d46c2f34cedd81e2fd5239",
"method": "spawn"
},
{
"target": "0x77193b3008464a6db19a02e329d847a1f0e5041c7ca9d2abe145e95402879b7",
"target": "0x7d32611d1b96df37b041f0a285bf340227cebc144d46c2f34cedd81e2fd5239",
"method": "move"
},
{
"target": "0x77193b3008464a6db19a02e329d847a1f0e5041c7ca9d2abe145e95402879b7",
"target": "0x7d32611d1b96df37b041f0a285bf340227cebc144d46c2f34cedd81e2fd5239",
"method": "set_player_config"
},
{
"target": "0x77193b3008464a6db19a02e329d847a1f0e5041c7ca9d2abe145e95402879b7",
"target": "0x7d32611d1b96df37b041f0a285bf340227cebc144d46c2f34cedd81e2fd5239",
"method": "reset_player_config"
},
{
"target": "0x77193b3008464a6db19a02e329d847a1f0e5041c7ca9d2abe145e95402879b7",
"target": "0x7d32611d1b96df37b041f0a285bf340227cebc144d46c2f34cedd81e2fd5239",
"method": "set_player_server_profile"
},
{
"target": "0x77193b3008464a6db19a02e329d847a1f0e5041c7ca9d2abe145e95402879b7",
"target": "0x7d32611d1b96df37b041f0a285bf340227cebc144d46c2f34cedd81e2fd5239",
"method": "set_models"
},
{
"target": "0x77193b3008464a6db19a02e329d847a1f0e5041c7ca9d2abe145e95402879b7",
"target": "0x7d32611d1b96df37b041f0a285bf340227cebc144d46c2f34cedd81e2fd5239",
"method": "enter_dungeon"
},
{
"target": "0x77193b3008464a6db19a02e329d847a1f0e5041c7ca9d2abe145e95402879b7",
"method": "upgrade"
},
{
"target": "0x5a96bc248612b19a137e15597af8aaf0571f252cc0dd7916647f5d392904167",
"target": "0x7d32611d1b96df37b041f0a285bf340227cebc144d46c2f34cedd81e2fd5239",
"method": "upgrade"
},
{
"target": "0x4bf1624ebc515bc20b8a7c4c2f669872cd61e3abab0cc77d9b9c91fcce11bdc",
"target": "0x54d0f13bf3fb5f15a8674c5204aad35e3022af96bcc23bdbd16b7e297ffd399",
"method": "uuid"
},
{
"target": "0x4bf1624ebc515bc20b8a7c4c2f669872cd61e3abab0cc77d9b9c91fcce11bdc",
"target": "0x54d0f13bf3fb5f15a8674c5204aad35e3022af96bcc23bdbd16b7e297ffd399",
"method": "set_metadata"
},
{
"target": "0x4bf1624ebc515bc20b8a7c4c2f669872cd61e3abab0cc77d9b9c91fcce11bdc",
"target": "0x54d0f13bf3fb5f15a8674c5204aad35e3022af96bcc23bdbd16b7e297ffd399",
"method": "register_namespace"
},
{
"target": "0x4bf1624ebc515bc20b8a7c4c2f669872cd61e3abab0cc77d9b9c91fcce11bdc",
"target": "0x54d0f13bf3fb5f15a8674c5204aad35e3022af96bcc23bdbd16b7e297ffd399",
"method": "register_event"
},
{
"target": "0x4bf1624ebc515bc20b8a7c4c2f669872cd61e3abab0cc77d9b9c91fcce11bdc",
"target": "0x54d0f13bf3fb5f15a8674c5204aad35e3022af96bcc23bdbd16b7e297ffd399",
"method": "register_model"
},
{
"target": "0x4bf1624ebc515bc20b8a7c4c2f669872cd61e3abab0cc77d9b9c91fcce11bdc",
"target": "0x54d0f13bf3fb5f15a8674c5204aad35e3022af96bcc23bdbd16b7e297ffd399",
"method": "register_contract"
},
{
"target": "0x4bf1624ebc515bc20b8a7c4c2f669872cd61e3abab0cc77d9b9c91fcce11bdc",
"target": "0x54d0f13bf3fb5f15a8674c5204aad35e3022af96bcc23bdbd16b7e297ffd399",
"method": "init_contract"
},
{
"target": "0x4bf1624ebc515bc20b8a7c4c2f669872cd61e3abab0cc77d9b9c91fcce11bdc",
"target": "0x54d0f13bf3fb5f15a8674c5204aad35e3022af96bcc23bdbd16b7e297ffd399",
"method": "upgrade_event"
},
{
"target": "0x4bf1624ebc515bc20b8a7c4c2f669872cd61e3abab0cc77d9b9c91fcce11bdc",
"target": "0x54d0f13bf3fb5f15a8674c5204aad35e3022af96bcc23bdbd16b7e297ffd399",
"method": "upgrade_model"
},
{
"target": "0x4bf1624ebc515bc20b8a7c4c2f669872cd61e3abab0cc77d9b9c91fcce11bdc",
"target": "0x54d0f13bf3fb5f15a8674c5204aad35e3022af96bcc23bdbd16b7e297ffd399",
"method": "upgrade_contract"
},
{
"target": "0x4bf1624ebc515bc20b8a7c4c2f669872cd61e3abab0cc77d9b9c91fcce11bdc",
"target": "0x54d0f13bf3fb5f15a8674c5204aad35e3022af96bcc23bdbd16b7e297ffd399",
"method": "emit_event"
},
{
"target": "0x4bf1624ebc515bc20b8a7c4c2f669872cd61e3abab0cc77d9b9c91fcce11bdc",
"target": "0x54d0f13bf3fb5f15a8674c5204aad35e3022af96bcc23bdbd16b7e297ffd399",
"method": "emit_events"
},
{
"target": "0x4bf1624ebc515bc20b8a7c4c2f669872cd61e3abab0cc77d9b9c91fcce11bdc",
"target": "0x54d0f13bf3fb5f15a8674c5204aad35e3022af96bcc23bdbd16b7e297ffd399",
"method": "set_entity"
},
{
"target": "0x4bf1624ebc515bc20b8a7c4c2f669872cd61e3abab0cc77d9b9c91fcce11bdc",
"target": "0x54d0f13bf3fb5f15a8674c5204aad35e3022af96bcc23bdbd16b7e297ffd399",
"method": "set_entities"
},
{
"target": "0x4bf1624ebc515bc20b8a7c4c2f669872cd61e3abab0cc77d9b9c91fcce11bdc",
"target": "0x54d0f13bf3fb5f15a8674c5204aad35e3022af96bcc23bdbd16b7e297ffd399",
"method": "delete_entity"
},
{
"target": "0x4bf1624ebc515bc20b8a7c4c2f669872cd61e3abab0cc77d9b9c91fcce11bdc",
"target": "0x54d0f13bf3fb5f15a8674c5204aad35e3022af96bcc23bdbd16b7e297ffd399",
"method": "delete_entities"
},
{
"target": "0x4bf1624ebc515bc20b8a7c4c2f669872cd61e3abab0cc77d9b9c91fcce11bdc",
"target": "0x54d0f13bf3fb5f15a8674c5204aad35e3022af96bcc23bdbd16b7e297ffd399",
"method": "grant_owner"
},
{
"target": "0x4bf1624ebc515bc20b8a7c4c2f669872cd61e3abab0cc77d9b9c91fcce11bdc",
"target": "0x54d0f13bf3fb5f15a8674c5204aad35e3022af96bcc23bdbd16b7e297ffd399",
"method": "revoke_owner"
},
{
"target": "0x4bf1624ebc515bc20b8a7c4c2f669872cd61e3abab0cc77d9b9c91fcce11bdc",
"target": "0x54d0f13bf3fb5f15a8674c5204aad35e3022af96bcc23bdbd16b7e297ffd399",
"method": "grant_writer"
},
{
"target": "0x4bf1624ebc515bc20b8a7c4c2f669872cd61e3abab0cc77d9b9c91fcce11bdc",
"target": "0x54d0f13bf3fb5f15a8674c5204aad35e3022af96bcc23bdbd16b7e297ffd399",
"method": "revoke_writer"
},
{
"target": "0x4bf1624ebc515bc20b8a7c4c2f669872cd61e3abab0cc77d9b9c91fcce11bdc",
"target": "0x54d0f13bf3fb5f15a8674c5204aad35e3022af96bcc23bdbd16b7e297ffd399",
"method": "upgrade"
},
{
Expand All @@ -135,4 +135,4 @@
"target": "0x41a78e741e5af2fec34b695679bc6891742439f7afb8484ecd7766661ad02bf",
"method": "deployContract"
}
]
]
Loading

0 comments on commit 8b2d976

Please sign in to comment.