forked from MystenLabs/sui
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[native bridge] - move compiler, execution changes for bridge (Mysten…
…Labs#16186) ## Description Adding move compiler object id and OTW exception for bridge prior adding to the framework package ## Test Plan How did you test the new or updated feature? --- If your changes are not user-facing and do not break anything, you can skip the following section. Otherwise, please briefly describe what has changed under the Release Notes section. ### Type of Change (Check all that apply) - [ ] protocol change - [ ] user-visible impact - [ ] breaking change for a client SDKs - [ ] breaking change for FNs (FN binary must upgrade) - [ ] breaking change for validators or node operators (must upgrade binaries) - [ ] breaking change for on-chain data layout - [ ] necessitate either a data wipe or data migration ### Release notes
- Loading branch information
1 parent
98da2c5
commit 6d67d93
Showing
8 changed files
with
84 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
// Copyright (c) Mysten Labs, Inc. | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
use crate::base_types::SequenceNumber; | ||
use crate::error::SuiResult; | ||
use crate::object::Owner; | ||
use crate::storage::ObjectStore; | ||
use crate::SUI_BRIDGE_OBJECT_ID; | ||
use move_core_types::ident_str; | ||
use move_core_types::identifier::IdentStr; | ||
|
||
pub const BRIDGE_MODULE_NAME: &IdentStr = ident_str!("bridge"); | ||
pub const BRIDGE_CREATE_FUNCTION_NAME: &IdentStr = ident_str!("create"); | ||
|
||
pub const BRIDGE_SUPPORTED_ASSET: &[&str] = &["btc", "eth", "usdc", "usdt"]; | ||
|
||
pub fn get_bridge_obj_initial_shared_version( | ||
object_store: &dyn ObjectStore, | ||
) -> SuiResult<Option<SequenceNumber>> { | ||
Ok(object_store | ||
.get_object(&SUI_BRIDGE_OBJECT_ID)? | ||
.map(|obj| match obj.owner { | ||
Owner::Shared { | ||
initial_shared_version, | ||
} => initial_shared_version, | ||
_ => unreachable!("Bridge object must be shared"), | ||
})) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters