From 78082136712ea3e616fc2e75434ed67d63dd7e9f Mon Sep 17 00:00:00 2001 From: jolestar Date: Tue, 13 Aug 2024 18:28:49 +0800 Subject: [PATCH] [framework] result and taproot_builder are graduate from nursery (#2423) --- frameworks/bitcoin-move/doc/README.md | 1 + .../bitcoin-move/doc/taproot_builder.md | 159 ++++++++++++ .../sources/taproot_builder.move | 4 +- .../tests/taproot_builder_test.move | 6 +- .../tests/taproot_builder_test.rs | 0 frameworks/moveos-stdlib/doc/README.md | 1 + frameworks/moveos-stdlib/doc/result.md | 228 ++++++++++++++++++ .../sources/result.move | 10 +- .../tests/result_tests.move | 4 +- frameworks/rooch-nursery/doc/README.md | 2 - .../rooch-nursery/doc/inscribe_factory.md | 2 +- .../rooch-nursery/doc/multisign_account.md | 4 +- frameworks/rooch-nursery/doc/result.md | 228 ------------------ .../rooch-nursery/doc/taproot_builder.md | 159 ------------ frameworks/rooch-nursery/doc/tick_info.md | 4 +- .../sources/inscribe_factory.move | 4 +- .../sources/multisign_account.move | 4 +- .../rooch-nursery/sources/tick_info.move | 2 +- 18 files changed, 411 insertions(+), 411 deletions(-) create mode 100644 frameworks/bitcoin-move/doc/taproot_builder.md rename frameworks/{rooch-nursery => bitcoin-move}/sources/taproot_builder.move (98%) rename frameworks/{rooch-nursery => bitcoin-move}/tests/taproot_builder_test.move (92%) rename frameworks/{rooch-nursery => bitcoin-move}/tests/taproot_builder_test.rs (100%) create mode 100644 frameworks/moveos-stdlib/doc/result.md rename frameworks/{rooch-nursery => moveos-stdlib}/sources/result.move (92%) rename frameworks/{rooch-nursery => moveos-stdlib}/tests/result_tests.move (89%) delete mode 100644 frameworks/rooch-nursery/doc/result.md delete mode 100644 frameworks/rooch-nursery/doc/taproot_builder.md diff --git a/frameworks/bitcoin-move/doc/README.md b/frameworks/bitcoin-move/doc/README.md index 05b7c0797e..e1d859dc47 100644 --- a/frameworks/bitcoin-move/doc/README.md +++ b/frameworks/bitcoin-move/doc/README.md @@ -20,6 +20,7 @@ This is the reference documentation of the Bitcoin Move Framework. - [`0x4::ord`](ord.md#0x4_ord) - [`0x4::pending_block`](pending_block.md#0x4_pending_block) - [`0x4::script_buf`](script_buf.md#0x4_script_buf) +- [`0x4::taproot_builder`](taproot_builder.md#0x4_taproot_builder) - [`0x4::types`](types.md#0x4_types) - [`0x4::utxo`](utxo.md#0x4_utxo) diff --git a/frameworks/bitcoin-move/doc/taproot_builder.md b/frameworks/bitcoin-move/doc/taproot_builder.md new file mode 100644 index 0000000000..549a59e785 --- /dev/null +++ b/frameworks/bitcoin-move/doc/taproot_builder.md @@ -0,0 +1,159 @@ + + + +# Module `0x4::taproot_builder` + +Taproot is a module that provides Bitcoin Taproot related functions. + + +- [Struct `TaprootBuilder`](#0x4_taproot_builder_TaprootBuilder) +- [Struct `NodeInfo`](#0x4_taproot_builder_NodeInfo) +- [Constants](#@Constants_0) +- [Function `new`](#0x4_taproot_builder_new) +- [Function `add_leaf`](#0x4_taproot_builder_add_leaf) +- [Function `finalize`](#0x4_taproot_builder_finalize) + + +
use 0x1::option;
+use 0x1::vector;
+use 0x2::bcs;
+use 0x2::compare;
+use 0x2::hash;
+use 0x2::result;
+use 0x4::script_buf;
+
+ + + + + +## Struct `TaprootBuilder` + + + +
struct TaprootBuilder has drop, store
+
+ + + + + +## Struct `NodeInfo` + + + +
struct NodeInfo has drop, store
+
+ + + + + +## Constants + + + + + + +
const ErrorInvalidMerkleTreeDepth: u64 = 1;
+
+ + + + + + + +
const ErrorNodeNotInDfsOrder: u64 = 2;
+
+ + + + + + + +
const ErrorOverCompleteTree: u64 = 3;
+
+ + + + + + + +
const ErrorUnreachable: u64 = 4;
+
+ + + + + + + +
const TAG_TAP_BRANCH: vector<u8> = [84, 97, 112, 66, 114, 97, 110, 99, 104];
+
+ + + + + + + +
const TAG_TAP_LEAF: vector<u8> = [84, 97, 112, 76, 101, 97, 102];
+
+ + + + + + + +
const TAPROOT_CONTROL_MAX_NODE_COUNT: u64 = 128;
+
+ + + + + +Tapscript leaf version. + + +
const TAPROOT_LEAF_TAPSCRIPT: u8 = 192;
+
+ + + + + +## Function `new` + + + +
public fun new(): taproot_builder::TaprootBuilder
+
+ + + + + +## Function `add_leaf` + + + +
public fun add_leaf(builder: &mut taproot_builder::TaprootBuilder, depth: u8, script_buf: script_buf::ScriptBuf): &mut taproot_builder::TaprootBuilder
+
+ + + + + +## Function `finalize` + +Finalize the builder, return the state root, +We use the address to represent the hash. + + +
public fun finalize(builder: taproot_builder::TaprootBuilder): result::Result<address, taproot_builder::TaprootBuilder>
+
diff --git a/frameworks/rooch-nursery/sources/taproot_builder.move b/frameworks/bitcoin-move/sources/taproot_builder.move similarity index 98% rename from frameworks/rooch-nursery/sources/taproot_builder.move rename to frameworks/bitcoin-move/sources/taproot_builder.move index 8b2ef058dd..205fe11de5 100644 --- a/frameworks/rooch-nursery/sources/taproot_builder.move +++ b/frameworks/bitcoin-move/sources/taproot_builder.move @@ -2,14 +2,14 @@ // SPDX-License-Identifier: Apache-2.0 /// Taproot is a module that provides Bitcoin Taproot related functions. -module rooch_nursery::taproot_builder { +module bitcoin_move::taproot_builder { use std::vector; use std::option::{Self, Option, is_none, is_some, none, destroy_some}; use moveos_std::bcs; use moveos_std::compare; use bitcoin_move::script_buf::{Self,ScriptBuf}; - use rooch_nursery::result::{err, ok, Result}; + use moveos_std::result::{err, ok, Result}; /// Tapscript leaf version. // https://github.com/bitcoin/bitcoin/blob/e826b22da252e0599c61d21c98ff89f366b3120f/src/script_buf/interpreter.h#L226 diff --git a/frameworks/rooch-nursery/tests/taproot_builder_test.move b/frameworks/bitcoin-move/tests/taproot_builder_test.move similarity index 92% rename from frameworks/rooch-nursery/tests/taproot_builder_test.move rename to frameworks/bitcoin-move/tests/taproot_builder_test.move index 74f19332e3..303c4356b2 100644 --- a/frameworks/rooch-nursery/tests/taproot_builder_test.move +++ b/frameworks/bitcoin-move/tests/taproot_builder_test.move @@ -1,9 +1,9 @@ #[test_only] -module rooch_nursery::taproot_builder_tests { +module bitcoin_move::taproot_builder_tests { use bitcoin_move::opcode; use bitcoin_move::script_buf; - use rooch_nursery::taproot_builder; - use rooch_nursery::result; + use bitcoin_move::taproot_builder; + use moveos_std::result; #[test] fun test_taproot_builder() { diff --git a/frameworks/rooch-nursery/tests/taproot_builder_test.rs b/frameworks/bitcoin-move/tests/taproot_builder_test.rs similarity index 100% rename from frameworks/rooch-nursery/tests/taproot_builder_test.rs rename to frameworks/bitcoin-move/tests/taproot_builder_test.rs diff --git a/frameworks/moveos-stdlib/doc/README.md b/frameworks/moveos-stdlib/doc/README.md index e0e484cf9f..cfe4ee7bfd 100644 --- a/frameworks/moveos-stdlib/doc/README.md +++ b/frameworks/moveos-stdlib/doc/README.md @@ -39,6 +39,7 @@ This is the reference documentation of the MoveOS standard library. - [`0x2::module_store`](module_store.md#0x2_module_store) - [`0x2::move_module`](move_module.md#0x2_move_module) - [`0x2::object`](object.md#0x2_object) +- [`0x2::result`](result.md#0x2_result) - [`0x2::rlp`](rlp.md#0x2_rlp) - [`0x2::signer`](signer.md#0x2_signer) - [`0x2::simple_map`](simple_map.md#0x2_simple_map) diff --git a/frameworks/moveos-stdlib/doc/result.md b/frameworks/moveos-stdlib/doc/result.md new file mode 100644 index 0000000000..daf977192b --- /dev/null +++ b/frameworks/moveos-stdlib/doc/result.md @@ -0,0 +1,228 @@ + + + +# Module `0x2::result` + + + +- [Struct `Result`](#0x2_result_Result) +- [Constants](#@Constants_0) +- [Function `ok`](#0x2_result_ok) +- [Function `is_ok`](#0x2_result_is_ok) +- [Function `get`](#0x2_result_get) +- [Function `err`](#0x2_result_err) +- [Function `err_str`](#0x2_result_err_str) +- [Function `is_err`](#0x2_result_is_err) +- [Function `get_err`](#0x2_result_get_err) +- [Function `as_err`](#0x2_result_as_err) +- [Function `unpack`](#0x2_result_unpack) +- [Function `and_then`](#0x2_result_and_then) +- [Function `unwrap`](#0x2_result_unwrap) +- [Function `unwrap_err`](#0x2_result_unwrap_err) +- [Function `assert_ok`](#0x2_result_assert_ok) +- [Function `assert_err`](#0x2_result_assert_err) + + +
use 0x1::option;
+use 0x1::string;
+
+ + + + + +## Struct `Result` + +The same as Rust's Result type. +Most of the time, we do not need the Result type in smart contract, we can directly abort the transaction. +But in some cases, we need to return a result to ensure the caller can handle the error. + + +
struct Result<T, E> has copy, drop
+
+ + + + + +## Constants + + + + +Expected the result is err but the result is ok. + + +
const ErrorExpectErr: u64 = 2;
+
+ + + + + +Expected the result is ok but the result is err. + + +
const ErrorExpectOk: u64 = 1;
+
+ + + + + +## Function `ok` + + + +
public fun ok<T, E>(value: T): result::Result<T, E>
+
+ + + + + +## Function `is_ok` + + + +
public fun is_ok<T, E>(result: &result::Result<T, E>): bool
+
+ + + + + +## Function `get` + + + +
public fun get<T, E>(result: &result::Result<T, E>): &option::Option<T>
+
+ + + + + +## Function `err` + + + +
public fun err<T, E>(err: E): result::Result<T, E>
+
+ + + + + +## Function `err_str` + +A shortcut to create a Result with an error String with +err_str(b"msg"). + + +
public fun err_str<T>(err: vector<u8>): result::Result<T, string::String>
+
+ + + + + +## Function `is_err` + + + +
public fun is_err<T, E>(result: &result::Result<T, E>): bool
+
+ + + + + +## Function `get_err` + + + +
public fun get_err<T, E>(result: &result::Result<T, E>): &option::Option<E>
+
+ + + + + +## Function `as_err` + +Convert an error Result to error Result. + + +
public fun as_err<U, T>(self: result::Result<T, string::String>): result::Result<U, string::String>
+
+ + + + + +## Function `unpack` + + + +
public fun unpack<T, E>(result: result::Result<T, E>): (option::Option<T>, option::Option<E>)
+
+ + + + + +## Function `and_then` + + + +
public fun and_then<U, T, E>(result: result::Result<U, E>, f: |U|result::Result<T, E>): result::Result<T, E>
+
+ + + + + +## Function `unwrap` + + + +
public fun unwrap<T, E: drop>(result: result::Result<T, E>): T
+
+ + + + + +## Function `unwrap_err` + + + +
public fun unwrap_err<T, E>(result: result::Result<T, E>): E
+
+ + + + + +## Function `assert_ok` + +Assert the result is ok, and return the value. +Otherwise, abort with the abort_code. +This function is inline, so it will be expanded in the caller. +This ensures the abort_code is the caller's location. + + +
public fun assert_ok<T, E>(result: result::Result<T, E>, abort_code: u64): T
+
+ + + + + +## Function `assert_err` + + + +
public fun assert_err<T, E>(result: result::Result<T, E>, abort_code: u64): E
+
diff --git a/frameworks/rooch-nursery/sources/result.move b/frameworks/moveos-stdlib/sources/result.move similarity index 92% rename from frameworks/rooch-nursery/sources/result.move rename to frameworks/moveos-stdlib/sources/result.move index 477775a348..e4f0446cdc 100644 --- a/frameworks/rooch-nursery/sources/result.move +++ b/frameworks/moveos-stdlib/sources/result.move @@ -1,7 +1,7 @@ // Copyright (c) RoochNetwork // SPDX-License-Identifier: Apache-2.0 -module rooch_nursery::result { +module moveos_std::result { use std::string::{Self, String}; use std::option::{Self, Option}; @@ -79,11 +79,11 @@ module rooch_nursery::result { } public inline fun and_then(result: Result, f: |U|Result): Result { - let (value, err) = rooch_nursery::result::unpack(result); + let (value, err) = moveos_std::result::unpack(result); if (std::option::is_some(&value)) { f(std::option::destroy_some(value)) } else { - rooch_nursery::result::err(std::option::destroy_some(err)) + moveos_std::result::err(std::option::destroy_some(err)) } } @@ -111,14 +111,14 @@ module rooch_nursery::result { /// This function is inline, so it will be expanded in the caller. /// This ensures the abort_code is the caller's location. public inline fun assert_ok(result: Result, abort_code: u64): T{ - let (value, err) = rooch_nursery::result::unpack(result); + let (value, err) = moveos_std::result::unpack(result); assert!(std::option::is_some(&value), abort_code); std::option::destroy_none(err); std::option::destroy_some(value) } public inline fun assert_err(result: Result, abort_code: u64): E{ - let (value, err) = rooch_nursery::result::unpack(result); + let (value, err) = moveos_std::result::unpack(result); assert!(std::option::is_some(&err), abort_code); std::option::destroy_none(value); std::option::destroy_some(err) diff --git a/frameworks/rooch-nursery/tests/result_tests.move b/frameworks/moveos-stdlib/tests/result_tests.move similarity index 89% rename from frameworks/rooch-nursery/tests/result_tests.move rename to frameworks/moveos-stdlib/tests/result_tests.move index b78e721ddc..013488f51f 100644 --- a/frameworks/rooch-nursery/tests/result_tests.move +++ b/frameworks/moveos-stdlib/tests/result_tests.move @@ -1,10 +1,10 @@ // Copyright (c) RoochNetwork // SPDX-License-Identifier: Apache-2.0 -module rooch_nursery::result_test { +module moveos_std::result_tests { use std::string::String; - use rooch_nursery::result::{Self, Result, ok, err_str, assert_ok}; + use moveos_std::result::{Self, Result, ok, err_str, assert_ok}; const ErrorForTest: u64 = 1; diff --git a/frameworks/rooch-nursery/doc/README.md b/frameworks/rooch-nursery/doc/README.md index cc436e344d..289c5ef7f7 100644 --- a/frameworks/rooch-nursery/doc/README.md +++ b/frameworks/rooch-nursery/doc/README.md @@ -20,8 +20,6 @@ This is the reference documentation of the Rooch Nursery Framework. - [`0xa::inscribe_factory`](inscribe_factory.md#0xa_inscribe_factory) - [`0xa::mint_get_factory`](mint_get_factory.md#0xa_mint_get_factory) - [`0xa::multisign_account`](multisign_account.md#0xa_multisign_account) -- [`0xa::result`](result.md#0xa_result) -- [`0xa::taproot_builder`](taproot_builder.md#0xa_taproot_builder) - [`0xa::tick_info`](tick_info.md#0xa_tick_info) diff --git a/frameworks/rooch-nursery/doc/inscribe_factory.md b/frameworks/rooch-nursery/doc/inscribe_factory.md index 10e9e5fe1e..829d24350e 100644 --- a/frameworks/rooch-nursery/doc/inscribe_factory.md +++ b/frameworks/rooch-nursery/doc/inscribe_factory.md @@ -24,6 +24,7 @@ Bitseed inscribe inscription factory use 0x2::hash; use 0x2::hex; use 0x2::object; +use 0x2::result; use 0x2::simple_map; use 0x2::string_utils; use 0x2::wasm; @@ -31,7 +32,6 @@ Bitseed inscribe inscription factory use 0x4::ord; use 0x4::types; use 0xa::bitseed; -use 0xa::result; use 0xa::tick_info; diff --git a/frameworks/rooch-nursery/doc/multisign_account.md b/frameworks/rooch-nursery/doc/multisign_account.md index 11ff37e68d..0c3914ae70 100644 --- a/frameworks/rooch-nursery/doc/multisign_account.md +++ b/frameworks/rooch-nursery/doc/multisign_account.md @@ -26,6 +26,7 @@ Bitcoin multisign account module use 0x2::bcs; use 0x2::compare; use 0x2::object; +use 0x2::result; use 0x2::signer; use 0x2::table; use 0x2::table_vec; @@ -33,8 +34,7 @@ Bitcoin multisign account module use 0x3::ecdsa_k1; use 0x4::opcode; use 0x4::script_buf; -use 0xa::result; -use 0xa::taproot_builder; +use 0x4::taproot_builder; diff --git a/frameworks/rooch-nursery/doc/result.md b/frameworks/rooch-nursery/doc/result.md deleted file mode 100644 index 9f4d658a3a..0000000000 --- a/frameworks/rooch-nursery/doc/result.md +++ /dev/null @@ -1,228 +0,0 @@ - - - -# Module `0xa::result` - - - -- [Struct `Result`](#0xa_result_Result) -- [Constants](#@Constants_0) -- [Function `ok`](#0xa_result_ok) -- [Function `is_ok`](#0xa_result_is_ok) -- [Function `get`](#0xa_result_get) -- [Function `err`](#0xa_result_err) -- [Function `err_str`](#0xa_result_err_str) -- [Function `is_err`](#0xa_result_is_err) -- [Function `get_err`](#0xa_result_get_err) -- [Function `as_err`](#0xa_result_as_err) -- [Function `unpack`](#0xa_result_unpack) -- [Function `and_then`](#0xa_result_and_then) -- [Function `unwrap`](#0xa_result_unwrap) -- [Function `unwrap_err`](#0xa_result_unwrap_err) -- [Function `assert_ok`](#0xa_result_assert_ok) -- [Function `assert_err`](#0xa_result_assert_err) - - -
use 0x1::option;
-use 0x1::string;
-
- - - - - -## Struct `Result` - -The same as Rust's Result type. -Most of the time, we do not need the Result type in smart contract, we can directly abort the transaction. -But in some cases, we need to return a result to ensure the caller can handle the error. - - -
struct Result<T, E> has copy, drop
-
- - - - - -## Constants - - - - -Expected the result is err but the result is ok. - - -
const ErrorExpectErr: u64 = 2;
-
- - - - - -Expected the result is ok but the result is err. - - -
const ErrorExpectOk: u64 = 1;
-
- - - - - -## Function `ok` - - - -
public fun ok<T, E>(value: T): result::Result<T, E>
-
- - - - - -## Function `is_ok` - - - -
public fun is_ok<T, E>(result: &result::Result<T, E>): bool
-
- - - - - -## Function `get` - - - -
public fun get<T, E>(result: &result::Result<T, E>): &option::Option<T>
-
- - - - - -## Function `err` - - - -
public fun err<T, E>(err: E): result::Result<T, E>
-
- - - - - -## Function `err_str` - -A shortcut to create a Result with an error String with -err_str(b"msg"). - - -
public fun err_str<T>(err: vector<u8>): result::Result<T, string::String>
-
- - - - - -## Function `is_err` - - - -
public fun is_err<T, E>(result: &result::Result<T, E>): bool
-
- - - - - -## Function `get_err` - - - -
public fun get_err<T, E>(result: &result::Result<T, E>): &option::Option<E>
-
- - - - - -## Function `as_err` - -Convert an error Result to error Result. - - -
public fun as_err<U, T>(self: result::Result<T, string::String>): result::Result<U, string::String>
-
- - - - - -## Function `unpack` - - - -
public fun unpack<T, E>(result: result::Result<T, E>): (option::Option<T>, option::Option<E>)
-
- - - - - -## Function `and_then` - - - -
public fun and_then<U, T, E>(result: result::Result<U, E>, f: |U|result::Result<T, E>): result::Result<T, E>
-
- - - - - -## Function `unwrap` - - - -
public fun unwrap<T, E: drop>(result: result::Result<T, E>): T
-
- - - - - -## Function `unwrap_err` - - - -
public fun unwrap_err<T, E>(result: result::Result<T, E>): E
-
- - - - - -## Function `assert_ok` - -Assert the result is ok, and return the value. -Otherwise, abort with the abort_code. -This function is inline, so it will be expanded in the caller. -This ensures the abort_code is the caller's location. - - -
public fun assert_ok<T, E>(result: result::Result<T, E>, abort_code: u64): T
-
- - - - - -## Function `assert_err` - - - -
public fun assert_err<T, E>(result: result::Result<T, E>, abort_code: u64): E
-
diff --git a/frameworks/rooch-nursery/doc/taproot_builder.md b/frameworks/rooch-nursery/doc/taproot_builder.md deleted file mode 100644 index ed36c5d489..0000000000 --- a/frameworks/rooch-nursery/doc/taproot_builder.md +++ /dev/null @@ -1,159 +0,0 @@ - - - -# Module `0xa::taproot_builder` - -Taproot is a module that provides Bitcoin Taproot related functions. - - -- [Struct `TaprootBuilder`](#0xa_taproot_builder_TaprootBuilder) -- [Struct `NodeInfo`](#0xa_taproot_builder_NodeInfo) -- [Constants](#@Constants_0) -- [Function `new`](#0xa_taproot_builder_new) -- [Function `add_leaf`](#0xa_taproot_builder_add_leaf) -- [Function `finalize`](#0xa_taproot_builder_finalize) - - -
use 0x1::option;
-use 0x1::vector;
-use 0x2::bcs;
-use 0x2::compare;
-use 0x2::hash;
-use 0x4::script_buf;
-use 0xa::result;
-
- - - - - -## Struct `TaprootBuilder` - - - -
struct TaprootBuilder has drop, store
-
- - - - - -## Struct `NodeInfo` - - - -
struct NodeInfo has drop, store
-
- - - - - -## Constants - - - - - - -
const ErrorInvalidMerkleTreeDepth: u64 = 1;
-
- - - - - - - -
const ErrorNodeNotInDfsOrder: u64 = 2;
-
- - - - - - - -
const ErrorOverCompleteTree: u64 = 3;
-
- - - - - - - -
const ErrorUnreachable: u64 = 4;
-
- - - - - - - -
const TAG_TAP_BRANCH: vector<u8> = [84, 97, 112, 66, 114, 97, 110, 99, 104];
-
- - - - - - - -
const TAG_TAP_LEAF: vector<u8> = [84, 97, 112, 76, 101, 97, 102];
-
- - - - - - - -
const TAPROOT_CONTROL_MAX_NODE_COUNT: u64 = 128;
-
- - - - - -Tapscript leaf version. - - -
const TAPROOT_LEAF_TAPSCRIPT: u8 = 192;
-
- - - - - -## Function `new` - - - -
public fun new(): taproot_builder::TaprootBuilder
-
- - - - - -## Function `add_leaf` - - - -
public fun add_leaf(builder: &mut taproot_builder::TaprootBuilder, depth: u8, script_buf: script_buf::ScriptBuf): &mut taproot_builder::TaprootBuilder
-
- - - - - -## Function `finalize` - -Finalize the builder, return the state root, -We use the address to represent the hash. - - -
public fun finalize(builder: taproot_builder::TaprootBuilder): result::Result<address, taproot_builder::TaprootBuilder>
-
diff --git a/frameworks/rooch-nursery/doc/tick_info.md b/frameworks/rooch-nursery/doc/tick_info.md index c32cc9b63f..e1d716ae5c 100644 --- a/frameworks/rooch-nursery/doc/tick_info.md +++ b/frameworks/rooch-nursery/doc/tick_info.md @@ -28,13 +28,13 @@
use 0x1::option;
 use 0x1::string;
 use 0x2::object;
+use 0x2::result;
 use 0x2::signer;
 use 0x2::string_utils;
 use 0x2::tx_context;
 use 0x2::type_info;
 use 0x4::ord;
 use 0xa::bitseed;
-use 0xa::result;
 
@@ -184,7 +184,7 @@ Check if the tick is deployed. -
public(friend) fun mint_on_bitcoin(metaprotocol: string::String, tick: string::String, amount: u64): result::Result<object::Object<bitseed::Bitseed>, string::String>
+
public(friend) fun mint_on_bitcoin(metaprotocol: string::String, tick: string::String, amount: u64): result::Result<object::Object<bitseed::Bitseed>, string::String>
 
diff --git a/frameworks/rooch-nursery/sources/inscribe_factory.move b/frameworks/rooch-nursery/sources/inscribe_factory.move index f539e8fd61..b05b378509 100644 --- a/frameworks/rooch-nursery/sources/inscribe_factory.move +++ b/frameworks/rooch-nursery/sources/inscribe_factory.move @@ -21,7 +21,7 @@ module rooch_nursery::inscribe_factory { use rooch_nursery::bitseed::{Self, Bitseed}; use rooch_nursery::tick_info; - use rooch_nursery::result::{Self, Result, err_str, ok, is_err, as_err}; + use moveos_std::result::{Self, Result, err_str, ok, is_err, as_err}; const BIT_SEED_DEPLOY: vector = b"bitseed_deploy"; const BIT_SEED_MINT: vector = b"bitseed_mint"; @@ -750,7 +750,7 @@ module rooch_nursery::inscribe_factory { #[test_only] use moveos_std::features; #[test_only] - use rooch_nursery::result::{is_ok}; + use moveos_std::result::{is_ok}; #[test(genesis_account=@0x4)] fun test_is_valid_bitseed_mint_fail_with_tick_not_deploy(genesis_account: &signer){ diff --git a/frameworks/rooch-nursery/sources/multisign_account.move b/frameworks/rooch-nursery/sources/multisign_account.move index 7c6f11ba6a..1898bb5912 100644 --- a/frameworks/rooch-nursery/sources/multisign_account.move +++ b/frameworks/rooch-nursery/sources/multisign_account.move @@ -17,8 +17,8 @@ module rooch_nursery::multisign_account{ use bitcoin_move::script_buf::{Self, ScriptBuf}; use rooch_framework::ecdsa_k1; use rooch_framework::bitcoin_address::{Self, BitcoinAddress}; - use rooch_nursery::taproot_builder; - use rooch_nursery::result; + use bitcoin_move::taproot_builder; + use moveos_std::result; const PROPOSAL_STATUS_PENDING: u8 = 0; const PROPOSAL_STATUS_APPROVED: u8 = 1; diff --git a/frameworks/rooch-nursery/sources/tick_info.move b/frameworks/rooch-nursery/sources/tick_info.move index 5909c7ad27..f70176a237 100644 --- a/frameworks/rooch-nursery/sources/tick_info.move +++ b/frameworks/rooch-nursery/sources/tick_info.move @@ -14,7 +14,7 @@ module rooch_nursery::tick_info { use bitcoin_move::ord::{Self, InscriptionID}; use rooch_nursery::bitseed::{Self, Bitseed}; - use rooch_nursery::result::{Result, ok, err_str}; + use moveos_std::result::{Result, ok, err_str}; const ErrorMetaprotocolNotFound: u64 = 1; const ErrorTickNotFound: u64 = 2;