From 4d883484d2c9205e2702aa982f42b386ec93c396 Mon Sep 17 00:00:00 2001 From: alnoki <43892045+alnoki@users.noreply.github.com> Date: Mon, 30 Sep 2024 16:53:58 -0700 Subject: [PATCH] Add Move v2 instructions --- src/move/research/red_black_map/README.md | 8 +++++++- .../red_black_map/sources/red_black_map.move | 12 +++++++----- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/src/move/research/red_black_map/README.md b/src/move/research/red_black_map/README.md index d8d6fbd..2db524c 100644 --- a/src/move/research/red_black_map/README.md +++ b/src/move/research/red_black_map/README.md @@ -1,6 +1,12 @@ +Ensure proper `movefmt` version >= `1.0.5`: + +```sh +aptos update movefmt --target-version 1.0.5 +``` + Test and format: ```sh aptos move test --dev --move-2 -movefmt --file-path sources/red_black_map.move +aptos move fmt ``` \ No newline at end of file diff --git a/src/move/research/red_black_map/sources/red_black_map.move b/src/move/research/red_black_map/sources/red_black_map.move index ebf6a74..3771848 100644 --- a/src/move/research/red_black_map/sources/red_black_map.move +++ b/src/move/research/red_black_map/sources/red_black_map.move @@ -47,12 +47,14 @@ module econia::red_black_map { Map { root: Pointer::Null, nodes: vector::empty() } } - public fun contains(self: &Map, key: u256): bool { - match (self.search(key)) { - Found { .. } => true, - NotFound { .. } => false + /* + public fun contains(self: &Map, key: u256): bool { + match (self.search(key)) { + Found { node: _, side_as_child: _ } => true, + NotFound { prospective_parent: _, prospective_side_as_child: _ } => false + } } - } + */ public fun insert(self: &mut Map, key: u256, value: V) { match(self.root) {