From 3a424c725095e9f13ff337b7eacb1707f8fdfb62 Mon Sep 17 00:00:00 2001 From: web3olalala Date: Sun, 24 Sep 2023 16:33:22 +0800 Subject: [PATCH 1/4] Update comp id --- examples/Move.lock | 2 +- .../sources/codegen/components/multi_column.move | 2 +- .../sources/codegen/components/single_column.move | 2 +- .../sources/codegen/components/single_struct.move | 2 +- .../sources/codegen/components/single_value.move | 2 +- examples/sources/system/example_system.move | 12 ++++++++---- 6 files changed, 13 insertions(+), 9 deletions(-) diff --git a/examples/Move.lock b/examples/Move.lock index 8eff5f24..7e64b8d0 100644 --- a/examples/Move.lock +++ b/examples/Move.lock @@ -2,7 +2,7 @@ [move] version = 0 -manifest_digest = "29EBC8EEB6008703DCFCFC4C49D84765A6C3F555229A11B3917FD950A89CBD15" +manifest_digest = "CDB2CA0F065ECB73601AA770888CB620BD26EEF2D4C702F01BE21AF87435406F" deps_digest = "112928C94A84031C09CD9B9D1D44B149B73FC0EEA5FA8D8B2D7CA4D91936335A" dependencies = [ diff --git a/examples/sources/codegen/components/multi_column.move b/examples/sources/codegen/components/multi_column.move index 8a258cd8..3e81075f 100644 --- a/examples/sources/codegen/components/multi_column.move +++ b/examples/sources/codegen/components/multi_column.move @@ -12,7 +12,7 @@ module examples::multi_column_comp { friend examples::example_system; public fun id(): address { - entity_key::from_bytes(b"Multi_column Comp") + entity_key::from_bytes(b"multi_column") } // state diff --git a/examples/sources/codegen/components/single_column.move b/examples/sources/codegen/components/single_column.move index 0f5550c6..0455d098 100644 --- a/examples/sources/codegen/components/single_column.move +++ b/examples/sources/codegen/components/single_column.move @@ -12,7 +12,7 @@ module examples::single_column_comp { friend examples::example_system; public fun id(): address { - entity_key::from_bytes(b"Single_column Comp") + entity_key::from_bytes(b"single_column") } // value diff --git a/examples/sources/codegen/components/single_struct.move b/examples/sources/codegen/components/single_struct.move index 3dbb33d5..f1cacd8e 100644 --- a/examples/sources/codegen/components/single_struct.move +++ b/examples/sources/codegen/components/single_struct.move @@ -10,7 +10,7 @@ module examples::single_struct_comp { friend examples::example_system; public fun id(): address { - entity_key::from_bytes(b"Single_struct Comp") + entity_key::from_bytes(b"single_struct") } // admin diff --git a/examples/sources/codegen/components/single_value.move b/examples/sources/codegen/components/single_value.move index 9e72d9e8..0e0256fd 100644 --- a/examples/sources/codegen/components/single_value.move +++ b/examples/sources/codegen/components/single_value.move @@ -10,7 +10,7 @@ module examples::single_value_comp { friend examples::example_system; public fun id(): address { - entity_key::from_bytes(b"Single_value Comp") + entity_key::from_bytes(b"single_value") } // value diff --git a/examples/sources/system/example_system.move b/examples/sources/system/example_system.move index 24c2d26d..42be24d9 100644 --- a/examples/sources/system/example_system.move +++ b/examples/sources/system/example_system.move @@ -1,4 +1,6 @@ module examples::example_system { + use examples::single_value_comp; + use examples::world::World; #[test_only] use std::ascii::string; #[test_only] @@ -12,16 +14,18 @@ module examples::example_system { #[test_only] use examples::single_struct_comp; #[test_only] - use examples::single_value_comp; - #[test_only] use examples::world; #[test_only] - use examples::world::World; - #[test_only] use sui::test_scenario; #[test_only] use sui::test_scenario::Scenario; + public entry fun increase(world: &mut World) { + let old_number = single_value_comp::get(world); + let new_number = old_number + 10; + single_value_comp::update(world, new_number); + } + #[test_only] public fun init_test(): Scenario { let scenario_val = test_scenario::begin(@0x0001); From 9ba48f34c297d6f2de16306b1e5f6aaed6257a52 Mon Sep 17 00:00:00 2001 From: web3olalala Date: Sun, 24 Sep 2023 16:59:58 +0800 Subject: [PATCH 2/4] Add comp names --- examples/sources/codegen/components/multi_column.move | 7 +++++-- .../sources/codegen/components/single_column.move | 7 +++++-- .../sources/codegen/components/single_struct.move | 7 +++++-- examples/sources/codegen/components/single_value.move | 7 +++++-- examples/sources/codegen/eps/world.move | 11 ++++++++++- examples/sources/system/example_system.move | 8 ++++++++ 6 files changed, 38 insertions(+), 9 deletions(-) diff --git a/examples/sources/codegen/components/multi_column.move b/examples/sources/codegen/components/multi_column.move index 3e81075f..f48d8ff8 100644 --- a/examples/sources/codegen/components/multi_column.move +++ b/examples/sources/codegen/components/multi_column.move @@ -11,8 +11,10 @@ module examples::multi_column_comp { // Systems friend examples::example_system; + const COMPONENT_NAME: vector = b"multi_column"; + public fun id(): address { - entity_key::from_bytes(b"multi_column") + entity_key::from_bytes(COMPONENT_NAME) } // state @@ -29,7 +31,8 @@ module examples::multi_column_comp { world::add_component>( world, id(), - table::new(ctx) + table::new(ctx), + string(COMPONENT_NAME) ); } diff --git a/examples/sources/codegen/components/single_column.move b/examples/sources/codegen/components/single_column.move index 0455d098..d4eaaa9d 100644 --- a/examples/sources/codegen/components/single_column.move +++ b/examples/sources/codegen/components/single_column.move @@ -11,8 +11,10 @@ module examples::single_column_comp { // Systems friend examples::example_system; + const COMPONENT_NAME: vector = b"single_column"; + public fun id(): address { - entity_key::from_bytes(b"single_column") + entity_key::from_bytes(COMPONENT_NAME) } // value @@ -28,7 +30,8 @@ module examples::single_column_comp { world::add_component>( world, id(), - table::new(ctx) + table::new(ctx), + string(COMPONENT_NAME) ); } diff --git a/examples/sources/codegen/components/single_struct.move b/examples/sources/codegen/components/single_struct.move index f1cacd8e..974b9141 100644 --- a/examples/sources/codegen/components/single_struct.move +++ b/examples/sources/codegen/components/single_struct.move @@ -9,8 +9,10 @@ module examples::single_struct_comp { // Systems friend examples::example_system; + const COMPONENT_NAME: vector = b"single_struct"; + public fun id(): address { - entity_key::from_bytes(b"single_struct") + entity_key::from_bytes(COMPONENT_NAME) } // admin @@ -27,7 +29,8 @@ module examples::single_struct_comp { world::add_component( world, id(), - Field { data: encode(@0x1, 100) } + Field { data: encode(@0x1, 100) }, + string(COMPONENT_NAME) ); } diff --git a/examples/sources/codegen/components/single_value.move b/examples/sources/codegen/components/single_value.move index 0e0256fd..e68e8726 100644 --- a/examples/sources/codegen/components/single_value.move +++ b/examples/sources/codegen/components/single_value.move @@ -9,8 +9,10 @@ module examples::single_value_comp { // Systems friend examples::example_system; + const COMPONENT_NAME: vector = b"single_value"; + public fun id(): address { - entity_key::from_bytes(b"single_value") + entity_key::from_bytes(COMPONENT_NAME) } // value @@ -26,7 +28,8 @@ module examples::single_value_comp { world::add_component( world, id(), - Field { data: encode(1000) } + Field { data: encode(1000) }, + string(COMPONENT_NAME) ); } diff --git a/examples/sources/codegen/eps/world.move b/examples/sources/codegen/eps/world.move index a9b26291..d527fd62 100644 --- a/examples/sources/codegen/eps/world.move +++ b/examples/sources/codegen/eps/world.move @@ -1,6 +1,7 @@ module examples::world { use std::ascii::String; use std::option::Option; + use std::vector; use sui::tx_context; use sui::transfer; use sui::event; @@ -33,6 +34,8 @@ module examples::world { description: String, /// Components of the world components: Bag, + /// Component names of the world + component_names: vector, /// admin of the world admin: ID, /// Components of the world @@ -65,6 +68,7 @@ module examples::world { name, description, components: bag::new(ctx), + component_names: vector::empty(), admin: object::id(&admin), version: VERSION }; @@ -76,6 +80,10 @@ module examples::world { (world.name, world.description, world.version) } + public fun component_names(world: &World): vector { + world.component_names + } + public fun get_component(world: &World, id: address): &T { assert!(world.version == VERSION, EWrongVersion); assert!(bag::contains(&world.components, id), ECompDoesNotExist); @@ -88,9 +96,10 @@ module examples::world { bag::borrow_mut(&mut world.components, id) } - public fun add_component(world: &mut World, id: address, component: T){ + public fun add_component(world: &mut World, id: address, component: T, component_name: String){ assert!(world.version == VERSION, EWrongVersion); assert!(!bag::contains(&world.components, id), ECompAlreadyExists); + vector::push_back(&mut world.component_names, component_name); bag::add(&mut world.components, id, component); } diff --git a/examples/sources/system/example_system.move b/examples/sources/system/example_system.move index 42be24d9..a4eadf95 100644 --- a/examples/sources/system/example_system.move +++ b/examples/sources/system/example_system.move @@ -51,6 +51,14 @@ module examples::example_system { assert!(description == string(b"Examples description"), 0); assert!(version == 1, 0); + let names = world::component_names(&world); + assert!(names == vector[ + string(b"single_column"), + string(b"multi_column"), + string(b"single_value"), + string(b"single_struct") + ], 0); + test_scenario::return_shared(world); test_scenario::end(scenario_val); } From 5532c397d15c3a7b10b33ac63f41cb15e4a7e3c8 Mon Sep 17 00:00:00 2001 From: web3olalala Date: Sun, 24 Sep 2023 17:05:17 +0800 Subject: [PATCH 3/4] Update add_comp --- examples/sources/codegen/components/multi_column.move | 5 ++--- examples/sources/codegen/components/single_column.move | 5 ++--- examples/sources/codegen/components/single_struct.move | 5 ++--- examples/sources/codegen/components/single_value.move | 5 ++--- examples/sources/codegen/eps/world.move | 8 +++++--- 5 files changed, 13 insertions(+), 15 deletions(-) diff --git a/examples/sources/codegen/components/multi_column.move b/examples/sources/codegen/components/multi_column.move index f48d8ff8..3d9ffaf3 100644 --- a/examples/sources/codegen/components/multi_column.move +++ b/examples/sources/codegen/components/multi_column.move @@ -30,9 +30,8 @@ module examples::multi_column_comp { public fun register(world: &mut World, ctx: &mut TxContext) { world::add_component>( world, - id(), - table::new(ctx), - string(COMPONENT_NAME) + COMPONENT_NAME, + table::new(ctx) ); } diff --git a/examples/sources/codegen/components/single_column.move b/examples/sources/codegen/components/single_column.move index d4eaaa9d..92fc858f 100644 --- a/examples/sources/codegen/components/single_column.move +++ b/examples/sources/codegen/components/single_column.move @@ -29,9 +29,8 @@ module examples::single_column_comp { public fun register(world: &mut World, ctx: &mut TxContext) { world::add_component>( world, - id(), - table::new(ctx), - string(COMPONENT_NAME) + COMPONENT_NAME, + table::new(ctx) ); } diff --git a/examples/sources/codegen/components/single_struct.move b/examples/sources/codegen/components/single_struct.move index 974b9141..6a309688 100644 --- a/examples/sources/codegen/components/single_struct.move +++ b/examples/sources/codegen/components/single_struct.move @@ -28,9 +28,8 @@ module examples::single_struct_comp { public fun register(world: &mut World) { world::add_component( world, - id(), - Field { data: encode(@0x1, 100) }, - string(COMPONENT_NAME) + COMPONENT_NAME, + Field { data: encode(@0x1, 100) } ); } diff --git a/examples/sources/codegen/components/single_value.move b/examples/sources/codegen/components/single_value.move index e68e8726..c9f6a03f 100644 --- a/examples/sources/codegen/components/single_value.move +++ b/examples/sources/codegen/components/single_value.move @@ -27,9 +27,8 @@ module examples::single_value_comp { public fun register(world: &mut World) { world::add_component( world, - id(), - Field { data: encode(1000) }, - string(COMPONENT_NAME) + COMPONENT_NAME, + Field { data: encode(1000) } ); } diff --git a/examples/sources/codegen/eps/world.move b/examples/sources/codegen/eps/world.move index d527fd62..bcaf5430 100644 --- a/examples/sources/codegen/eps/world.move +++ b/examples/sources/codegen/eps/world.move @@ -1,7 +1,8 @@ module examples::world { - use std::ascii::String; + use std::ascii::{String, string}; use std::option::Option; use std::vector; + use examples::entity_key; use sui::tx_context; use sui::transfer; use sui::event; @@ -96,10 +97,11 @@ module examples::world { bag::borrow_mut(&mut world.components, id) } - public fun add_component(world: &mut World, id: address, component: T, component_name: String){ + public fun add_component(world: &mut World, component_name: vector, component: T){ assert!(world.version == VERSION, EWrongVersion); + let id = entity_key::from_bytes(component_name); assert!(!bag::contains(&world.components, id), ECompAlreadyExists); - vector::push_back(&mut world.component_names, component_name); + vector::push_back(&mut world.component_names, string(component_name)); bag::add(&mut world.components, id, component); } From b908b304573e205b83db10e55ed89d3ba73ee10a Mon Sep 17 00:00:00 2001 From: web3olalala Date: Sun, 24 Sep 2023 17:12:50 +0800 Subject: [PATCH 4/4] Update name --- .../codegen/components/multi_column.move | 26 +++++++------- .../codegen/components/single_column.move | 18 +++++----- .../codegen/components/single_struct.move | 20 +++++------ .../codegen/components/single_value.move | 12 +++---- examples/sources/codegen/eps/world.move | 34 +++++++++---------- examples/sources/system/example_system.move | 2 +- 6 files changed, 56 insertions(+), 56 deletions(-) diff --git a/examples/sources/codegen/components/multi_column.move b/examples/sources/codegen/components/multi_column.move index 3d9ffaf3..650f9982 100644 --- a/examples/sources/codegen/components/multi_column.move +++ b/examples/sources/codegen/components/multi_column.move @@ -11,10 +11,10 @@ module examples::multi_column_comp { // Systems friend examples::example_system; - const COMPONENT_NAME: vector = b"multi_column"; + const NAME: vector = b"multi_column"; public fun id(): address { - entity_key::from_bytes(COMPONENT_NAME) + entity_key::from_bytes(NAME) } // state @@ -28,35 +28,35 @@ module examples::multi_column_comp { } public fun register(world: &mut World, ctx: &mut TxContext) { - world::add_component>( + world::add_comp>( world, - COMPONENT_NAME, + NAME, table::new(ctx) ); } public(friend) fun add(world: &mut World, key: address, state: vector, last_update_time: u64) { - let component = world::get_mut_component>(world, id()); + let component = world::get_mut_comp>(world, id()); let data = encode(state, last_update_time); table::add(component, key, Field { data }); world::emit_add_event(id(), key, data) } public(friend) fun remove(world: &mut World, key: address) { - let component = world::get_mut_component>(world, id()); + let component = world::get_mut_comp>(world, id()); table::remove(component, key); world::emit_remove_event(id(), key) } public(friend) fun update(world: &mut World, key: address, state: vector, last_update_time: u64) { - let component = world::get_mut_component>(world, id()); + let component = world::get_mut_comp>(world, id()); let field = table::borrow_mut(component, key); let data = encode(state, last_update_time); field.data = data; world::emit_update_event(id(), some(key), data) } public(friend) fun update_state(world: &mut World, key: address, state: vector) { - let component = world::get_mut_component>(world, id()); + let component = world::get_mut_comp>(world, id()); let field = table::borrow_mut(component, key); let (_, last_update_time) = decode(field.data); let data = encode(state, last_update_time); @@ -65,7 +65,7 @@ module examples::multi_column_comp { } public(friend) fun update_last_update_time(world: &mut World, key: address, last_update_time: u64) { - let component = world::get_mut_component>(world, id()); + let component = world::get_mut_comp>(world, id()); let field = table::borrow_mut(component, key); let (state, _) = decode(field.data); let data = encode(state, last_update_time); @@ -74,27 +74,27 @@ module examples::multi_column_comp { } public fun get(world: &World, key: address): (vector,u64) { - let component = world::get_component>(world, id()); + let component = world::get_comp>(world, id()); let field = table::borrow(component, key); decode(field.data) } public fun get_state(world: &World, key: address): vector { - let component = world::get_component>(world, id()); + let component = world::get_comp>(world, id()); let field = table::borrow(component, key); let (state, _) = decode(field.data); state } public fun get_last_update_time(world: &World, key: address): u64 { - let component = world::get_component>(world, id()); + let component = world::get_comp>(world, id()); let field = table::borrow(component, key); let (_, last_update_time) = decode(field.data); last_update_time } public fun contains(world: &World, key: address): bool { - let component = world::get_component>(world, id()); + let component = world::get_comp>(world, id()); table::contains(component, key) } diff --git a/examples/sources/codegen/components/single_column.move b/examples/sources/codegen/components/single_column.move index 92fc858f..aa5ec8b1 100644 --- a/examples/sources/codegen/components/single_column.move +++ b/examples/sources/codegen/components/single_column.move @@ -11,10 +11,10 @@ module examples::single_column_comp { // Systems friend examples::example_system; - const COMPONENT_NAME: vector = b"single_column"; + const NAME: vector = b"single_column"; public fun id(): address { - entity_key::from_bytes(COMPONENT_NAME) + entity_key::from_bytes(NAME) } // value @@ -27,28 +27,28 @@ module examples::single_column_comp { } public fun register(world: &mut World, ctx: &mut TxContext) { - world::add_component>( + world::add_comp>( world, - COMPONENT_NAME, + NAME, table::new(ctx) ); } public(friend) fun add(world: &mut World, key: address, value: u64) { - let component = world::get_mut_component>(world, id()); + let component = world::get_mut_comp>(world, id()); let data = encode(value); table::add(component, key, Field { data }); world::emit_add_event(id(), key, data) } public(friend) fun remove(world: &mut World, key: address) { - let component = world::get_mut_component>(world, id()); + let component = world::get_mut_comp>(world, id()); table::remove(component, key); world::emit_remove_event(id(), key) } public(friend) fun update(world: &mut World, key: address, value: u64) { - let component = world::get_mut_component>(world, id()); + let component = world::get_mut_comp>(world, id()); let field = table::borrow_mut(component, key); let data = encode(value); field.data = data; @@ -56,13 +56,13 @@ module examples::single_column_comp { } public fun get(world: &World, key: address): u64 { - let component = world::get_component>(world, id()); + let component = world::get_comp>(world, id()); let field = table::borrow(component, key); decode(field.data) } public fun contains(world: &World, key: address): bool { - let component = world::get_component>(world, id()); + let component = world::get_comp>(world, id()); table::contains(component, key) } diff --git a/examples/sources/codegen/components/single_struct.move b/examples/sources/codegen/components/single_struct.move index 6a309688..58a200e8 100644 --- a/examples/sources/codegen/components/single_struct.move +++ b/examples/sources/codegen/components/single_struct.move @@ -9,10 +9,10 @@ module examples::single_struct_comp { // Systems friend examples::example_system; - const COMPONENT_NAME: vector = b"single_struct"; + const NAME: vector = b"single_struct"; public fun id(): address { - entity_key::from_bytes(COMPONENT_NAME) + entity_key::from_bytes(NAME) } // admin @@ -26,45 +26,45 @@ module examples::single_struct_comp { } public fun register(world: &mut World) { - world::add_component( + world::add_comp( world, - COMPONENT_NAME, + NAME, Field { data: encode(@0x1, 100) } ); } public(friend) fun update(world: &mut World, admin: address, fee: u64) { let data = encode(admin, fee); - world::get_mut_component(world, id()).data = data; + world::get_mut_comp(world, id()).data = data; world::emit_update_event(id(), none(), data) } public(friend) fun update_admin(world: &mut World, admin: address) { - let field = world::get_mut_component(world, id()); + let field = world::get_mut_comp(world, id()); let (_, fee) = decode(field.data); field.data = encode(admin, fee); world::emit_update_event(id(), none(), field.data) } public(friend) fun update_fee(world: &mut World, fee: u64) { - let field = world::get_mut_component(world, id()); + let field = world::get_mut_comp(world, id()); let (admin, _) = decode(field.data); field.data = encode(admin, fee); world::emit_update_event(id(), none(), field.data) } public fun get(world: &World): (address,u64) { - let data = world::get_component(world, id()).data; + let data = world::get_comp(world, id()).data; decode(data) } public fun get_admin(world: &World): address { - let data = world::get_component(world, id()).data; + let data = world::get_comp(world, id()).data; let (admin, _) = decode(data); admin } public fun get_fee(world: &World): u64 { - let data = world::get_component(world, id()).data; + let data = world::get_comp(world, id()).data; let (_, fee) = decode(data); fee } diff --git a/examples/sources/codegen/components/single_value.move b/examples/sources/codegen/components/single_value.move index c9f6a03f..f55a7038 100644 --- a/examples/sources/codegen/components/single_value.move +++ b/examples/sources/codegen/components/single_value.move @@ -9,10 +9,10 @@ module examples::single_value_comp { // Systems friend examples::example_system; - const COMPONENT_NAME: vector = b"single_value"; + const NAME: vector = b"single_value"; public fun id(): address { - entity_key::from_bytes(COMPONENT_NAME) + entity_key::from_bytes(NAME) } // value @@ -25,21 +25,21 @@ module examples::single_value_comp { } public fun register(world: &mut World) { - world::add_component( + world::add_comp( world, - COMPONENT_NAME, + NAME, Field { data: encode(1000) } ); } public(friend) fun update(world: &mut World, value: u64) { let data = encode(value); - world::get_mut_component(world, id()).data = data; + world::get_mut_comp(world, id()).data = data; world::emit_update_event(id(), none(), data) } public fun get(world: &World): u64 { - let data = world::get_component(world, id()).data; + let data = world::get_comp(world, id()).data; decode(data) } diff --git a/examples/sources/codegen/eps/world.move b/examples/sources/codegen/eps/world.move index bcaf5430..1dc3c0b0 100644 --- a/examples/sources/codegen/eps/world.move +++ b/examples/sources/codegen/eps/world.move @@ -34,9 +34,9 @@ module examples::world { /// Description of the world description: String, /// Components of the world - components: Bag, + comps: Bag, /// Component names of the world - component_names: vector, + compnames: vector, /// admin of the world admin: ID, /// Components of the world @@ -68,8 +68,8 @@ module examples::world { id: object::new(ctx), name, description, - components: bag::new(ctx), - component_names: vector::empty(), + comps: bag::new(ctx), + compnames: vector::empty(), admin: object::id(&admin), version: VERSION }; @@ -81,33 +81,33 @@ module examples::world { (world.name, world.description, world.version) } - public fun component_names(world: &World): vector { - world.component_names + public fun compnames(world: &World): vector { + world.compnames } - public fun get_component(world: &World, id: address): &T { + public fun get_comp(world: &World, id: address): &T { assert!(world.version == VERSION, EWrongVersion); - assert!(bag::contains(&world.components, id), ECompDoesNotExist); - bag::borrow(&world.components, id) + assert!(bag::contains(&world.comps, id), ECompDoesNotExist); + bag::borrow(&world.comps, id) } - public fun get_mut_component(world: &mut World, id: address): &mut T { + public fun get_mut_comp(world: &mut World, id: address): &mut T { assert!(world.version == VERSION, EWrongVersion); - assert!(bag::contains(&world.components, id), ECompDoesNotExist); - bag::borrow_mut(&mut world.components, id) + assert!(bag::contains(&world.comps, id), ECompDoesNotExist); + bag::borrow_mut(&mut world.comps, id) } - public fun add_component(world: &mut World, component_name: vector, component: T){ + public fun add_comp(world: &mut World, component_name: vector, component: T){ assert!(world.version == VERSION, EWrongVersion); let id = entity_key::from_bytes(component_name); - assert!(!bag::contains(&world.components, id), ECompAlreadyExists); - vector::push_back(&mut world.component_names, string(component_name)); - bag::add(&mut world.components, id, component); + assert!(!bag::contains(&world.comps, id), ECompAlreadyExists); + vector::push_back(&mut world.compnames, string(component_name)); + bag::add(&mut world.comps, id, component); } public fun contains(world: &mut World, id: address): bool { assert!(world.version == VERSION, EWrongVersion); - bag::contains(&mut world.components, id) + bag::contains(&mut world.comps, id) } public fun emit_remove_event(comp: address, key: address) { diff --git a/examples/sources/system/example_system.move b/examples/sources/system/example_system.move index a4eadf95..40416c14 100644 --- a/examples/sources/system/example_system.move +++ b/examples/sources/system/example_system.move @@ -51,7 +51,7 @@ module examples::example_system { assert!(description == string(b"Examples description"), 0); assert!(version == 1, 0); - let names = world::component_names(&world); + let names = world::compnames(&world); assert!(names == vector[ string(b"single_column"), string(b"multi_column"),