8000 Add support for vector<vector> by Levi0804 · Pull Request #3398 · rooch-network/rooch · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Add support for vector<vector> #3398

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

Levi0804
Copy link
@Levi0804 Levi0804 commented Mar 5, 2025

Summary

This PR adds support to pass vector as transaction arguments. Please let me know if these changes look good and whether I should constrain the concrete type of inner vector to u8.

Copy link
vercel bot commented Mar 5, 2025

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

Name Status Preview Comments Updated (UTC)
onchain-ai-chat ✅ Ready (Inspect) Visit Preview 💬 Add feedback Mar 5, 2025 4:41pm
rooch-portal-v2.1 ✅ Ready (Inspect) Visit Preview 💬 Add feedback Mar 5, 2025 4:41pm
test-portal ✅ Ready (Inspect) Visit Preview 💬 Add feedback Mar 5, 2025 4:41pm
1 Skipped Deployment
Name Status Preview Comments Updated (UTC)
rooch ⬜️ Ignored (Inspect) Visit Preview Mar 5, 2025 4:41pm

@jolestar
Copy link
Contributor
jolestar commented Mar 5, 2025

Can you add a sample entry function in

https://github.com/rooch-network/rooch/blob/02567e201e0b16f34d61b96ecb2f01c9b173b801/examples/entry_function_arguments/sources/entry_function.move

and call the function in

Scenario: entry_function example
Given a server for entry_function
Then cmd: "move publish -p ../../examples/entry_function_arguments/ --named-addresses rooch_examples=default --json"
Then assert: "{{$.move[-1].execution_info.status.type}} == executed"
Then cmd: "move run --function default::entry_function::emit_bool --args bool:true --json"
Then assert: "{{$.move[-1].execution_info.status.type}} == executed"
Then cmd: "move run --function default::entry_function::emit_u8 --args u8:3 --json"
Then assert: "{{$.move[-1].execution_info.status.type}} == executed"
Then cmd: "move run --function default::entry_function::emit_u8 --args 4u8 --json"
Then assert: "{{$.move[-1].execution_info.status.type}} == executed"
Then cmd: "move run --function default::entry_function::emit_address --args address:0x3242 --json"
Then assert: "{{$.move[-1].execution_info.status.type}} == executed"
Then cmd: "move run --function default::entry_function::emit_address --args @0x3242 --json"
Then assert: "{{$.move[-1].execution_info.status.type}} == executed"
Then cmd: "move run --function default::entry_function::emit_object_id --args object_id:0x3134 --json"
Then assert: "{{$.move[-1].execution_info.status.type}} == executed"
Then cmd: "move run --function default::entry_function::emit_string --args string:world --json"
Then assert: "{{$.move[-1].execution_info.status.type}} == executed"
Then cmd: "move run --function default::entry_function::emit_vec_u8 --args "vector<u8>:2,3,4" --json"
Then assert: "{{$.move[-1].execution_info.status.type}} == executed"
Then cmd: "move run --function default::entry_function::emit_vec_object_id --args "vector<object_id>:0x1324,0x41234,0x1234" --json"
Then assert: "{{$.move[-1].execution_info.status.type}} == executed"
Then cmd: "move run --function default::entry_function::emit_mix --args 3u8 --args "vector<object_id>:0x2342,0x3132" --json"
Then assert: "{{$.move[-1].execution_info.status.type}} == executed"
Then cmd: "move run --function default::entry_function::emit_object --args "object:default::entry_function::TestStruct" --json"
Then assert: "{{$.move[-1].execution_info.status.type}} == executed"
Then cmd: "move run --function default::entry_function::emit_object_mut --args "object:default::entry_function::TestStruct" --json"
Then assert: "{{$.move[-1].execution_info.status.type}} == executed"
Then stop the server

@Levi0804
Copy link
Author
Levi0804 commented Mar 5, 2025

Can you add a sample entry function in

https://github.com/rooch-network/rooch/blob/02567e201e0b16f34d61b96ecb2f01c9b173b801/examples/entry_function_arguments/sources/entry_function.move

and call the function in

Scenario: entry_function example
Given a server for entry_function
Then cmd: "move publish -p ../../examples/entry_function_arguments/ --named-addresses rooch_examples=default --json"
Then assert: "{{$.move[-1].execution_info.status.type}} == executed"
Then cmd: "move run --function default::entry_function::emit_bool --args bool:true --json"
Then assert: "{{$.move[-1].execution_info.status.type}} == executed"
Then cmd: "move run --function default::entry_function::emit_u8 --args u8:3 --json"
Then assert: "{{$.move[-1].execution_info.status.type}} == executed"
Then cmd: "move run --function default::entry_function::emit_u8 --args 4u8 --json"
Then assert: "{{$.move[-1].execution_info.status.type}} == executed"
Then cmd: "move run --function default::entry_function::emit_address --args address:0x3242 --json"
Then assert: "{{$.move[-1].execution_info.status.type}} == executed"
Then cmd: "move run --function default::entry_function::emit_address --args @0x3242 --json"
Then assert: "{{$.move[-1].execution_info.status.type}} == executed"
Then cmd: "move run --function default::entry_function::emit_object_id --args object_id:0x3134 --json"
Then assert: "{{$.move[-1].execution_info.status.type}} == executed"
Then cmd: "move run --function default::entry_function::emit_string --args string:world --json"
Then assert: "{{$.move[-1].execution_info.status.type}} == executed"
Then cmd: "move run --function default::entry_function::emit_vec_u8 --args "vector<u8>:2,3,4" --json"
Then assert: "{{$.move[-1].execution_info.status.type}} == executed"
Then cmd: "move run --function default::entry_function::emit_vec_object_id --args "vector<object_id>:0x1324,0x41234,0x1234" --json"
Then assert: "{{$.move[-1].execution_info.status.type}} == executed"
Then cmd: "move run --function default::entry_function::emit_mix --args 3u8 --args "vector<object_id>:0x2342,0x3132" --json"
Then assert: "{{$.move[-1].execution_info.status.type}} == executed"
Then cmd: "move run --function default::entry_function::emit_object --args "object:default::entry_function::TestStruct" --json"
Then assert: "{{$.move[-1].execution_info.status.type}} == executed"
Then cmd: "move run --function default::entry_function::emit_object_mut --args "object:default::entry_function::TestStruct" --json"
Then assert: "{{$.move[-1].execution_info.status.type}} == executed"
Then stop the server

I've made these changes. Do they look good to you?

@@ -263,6 +263,8 @@ Feature: Rooch CLI integration tests
Then assert: "{{$.move[-1].execution_info.status.type}} == executed"
Then cmd: "move run --function default::entry_function::emit_object_mut --args "object:default::entry_function::TestStruct" --json"
Then assert: "{{$.move[-1].execution_info.status.type}} == executed"
Then cmd: "move run --function default::entry_function::emit_vec_vec_u8 --args "vector<vector<u8>>:std::vector[2,3,4],std::vector[5,6,7]" --json"
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this a valid format?

Copy link
Author

Choose a reason for hiding this comment

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

Tests failed due to this. I'm looking into it.

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
0