Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update the Move library to the latest version from the upstream. #1222

Merged

Conversation

stevenlaw123
Copy link
Contributor

No description provided.

Copy link

vercel bot commented Dec 11, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Ignored Deployment
Name Status Preview Comments Updated (UTC)
rooch ⬜️ Ignored (Inspect) Visit Preview Dec 13, 2023 5:27am

@stevenlaw123 stevenlaw123 changed the title Fixing move compatibility Update the Move library to the latest version from the upstream. Dec 11, 2023
@@ -2,7 +2,7 @@
// SPDX-License-Identifier: Apache-2.0

use clap::Parser;
use clap::__macro_refs::once_cell::sync::Lazy;
use clap::__derive_refs::once_cell::sync::Lazy;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should it be use once_cell::sync::Lazy?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deal with this later.

Comment on lines +79 to +90
.transpose();

match result {
Ok(opt) => {
if let Some(data) = opt {
Ok((Some(data), 0))
} else {
Ok((None, 0))
}
}
Err(err) => Err(err),
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Simplify it by map?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deal with this later.

@@ -345,7 +346,9 @@ impl<'a> ExtendedChecker<'a> {
impl<'a> ExtendedChecker<'a> {
fn check_init_module(&mut self, module: &ModuleEnv) {
for ref fun in module.get_functions() {
if fun.get_identifier().as_ident_str() != INIT_FN_NAME_IDENTIFIER.as_ident_str() {
if fun.get_identifier().unwrap().as_ident_str()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Be careful unwrap; if it occurs in runtime, it will be a security bug.

}
}

impl<R> ModuleResolver for MoveOSResolverProxy<R>
where
R: StateResolver,
{
type Error = anyhow::Error;
fn get_module_metadata(&self, _module_id: &ModuleId) -> Vec<Metadata> {
vec![]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just return an empty array? Do we use the get_module_metadata in the VM?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Currently, the metadata for the module is manually read from the VM and the function is not invoked.

@@ -362,6 +362,41 @@ impl FromStr for FunctionArg {
}
}

pub fn parse_function_arg(s: &str) -> Result<FunctionArg, RoochError> {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not directly use from_str?

Comment on lines +35 to +36
let s = value.as_str().unwrap();
let ret = serde_json::from_str(s);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Which change affects the RPC response?

@@ -102,7 +102,7 @@ module moveos_std::type_info {
//assert!(type_name<TypeInfo>() == string::utf8(b"0x1::type_info::TypeInfo"), 9);
assert!(type_name<TypeInfo>() == string::utf8(b"0000000000000000000000000000000000000000000000000000000000000002::type_info::TypeInfo"), 9);

assert!(type_name<TestMultiGenerics<u8, u64, vector<u8>>>() == string::utf8(b"0000000000000000000000000000000000000000000000000000000000000002::type_info::TestMultiGenerics<u8,u64,vector<u8>>"), 10);
assert!(type_name<TestMultiGenerics<u8, u64, vector<u8>>>() == string::utf8(b"0000000000000000000000000000000000000000000000000000000000000002::type_info::TestMultiGenerics<u8u64vector<u8>>"), 10);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Which change affects this? The original format is right.

@@ -150,7 +150,7 @@ Feature: Rooch CLI integration tests
Given a server for kv_store
Then cmd: "move publish -p ../../examples/kv_store --named-addresses rooch_examples=default"
Then assert: "{{$.move[-1].execution_info.status.type}} == executed"
Then cmd: "move run --function default::kv_store::add_value --args string:key1 string:value1"
Then cmd: "move run --function default::kv_store::add_value --args string:key1 --args string:value1"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we not support splitting the args with blank?

@stevenlaw123 stevenlaw123 merged commit 672e8e7 into rooch-network:main Dec 13, 2023
5 checks passed
@stevenlaw123 stevenlaw123 deleted the fixing_move_compatibility branch December 13, 2023 14:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants