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

[Docs] - add 0x prefix and change SuiAddress and ObjectID to lowercase #1867

Merged
merged 3 commits into from
May 10, 2022

Conversation

patrickkuo
Copy link
Contributor

This is the doc changes for #1800.

I have added 0x prefix to all the addresses and object ID, also output of objects command now prints a table, I have included the change in docs as well.

@github-actions github-actions bot added the Type: Documentation Improvements or additions to documentation label May 9, 2022
Base automatically changed from pat/0x_everywhere to main May 9, 2022 08:41
Copy link
Contributor

@Clay-Mysten Clay-Mysten left a comment

Choose a reason for hiding this comment

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

Thank you so much, Patrick! I have just a couple of comments/questions. Otherwise, LGTM! Adding Ade for another set of eyes. Thanks again!

@@ -153,7 +153,7 @@ The signing tool will create and print out the signature and public key informat
You will see output resembling:
```shell
2022-04-25T18:50:06.031722Z INFO sui::sui_commands: Data to sign : VHJhbnNhY3Rpb25EYXRhOjoAAFHe8jecgzoGWyGlZ1sJ2KBFN8aZF7NIkDsM+3X8mrVCa7adg9HnVqUBAAAAAAAAACDOlrjlT0A18D0DqJLTU28ChUfRFtgHprmuOGCHYdv8YVHe8jecgzoGWyGlZ1sJ2KBFN8aZdZnY6h3kyWFtB38Wyg6zjN7KzAcBAAAAAAAAACDxI+LSHrFUxU0G8bPMXhF+46hpchJ22IHlpPv4FgNvGOgDAAAAAAAA
2022-04-25T18:50:06.031765Z INFO sui::sui_commands: Address : 51DEF2379C833A065B21A5675B09D8A04537C699
2022-04-25T18:50:06.031765Z INFO sui::sui_commands: Address : 0x51DEF2379C833A065B21A5675B09D8A04537C699
Copy link
Contributor

Choose a reason for hiding this comment

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

Should the letters be lower case here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

good catch! it should be lowercase

Readonly: false
ID: 0x124bbde643189b573c98d05c092f4927225421d7
Version: 1
Owner: Account Address ( 0x62cd5bc220b28a34265bcb24995fb45a51d39832 )
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 spacing in parenthesis correct?
( 0x62cd5bc220b28a34265bcb24995fb45a51d39832 )

@Clay-Mysten Clay-Mysten requested a review from oxade May 9, 2022 16:46
@@ -201,11 +201,11 @@ curl --location --request POST $SUI_RPC_HOST \
"method": "sui_moveCall",
"params": [
"{{owner_address}}",
"0000000000000000000000000000000000000002",
"0x2",
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 allow short form everywhere?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes, I have done some test manually and a unit test here

#[test]
fn test_object_id_zero_padding() {
let hex = "0x2";
let long_hex = "0x0000000000000000000000000000000000000002";
let long_hex_alt = "0000000000000000000000000000000000000002";
let obj_id_1 = ObjectID::from_hex_literal(hex).unwrap();
let obj_id_2 = ObjectID::from_hex_literal(long_hex).unwrap();
let obj_id_3 = ObjectID::from_hex(long_hex_alt).unwrap();
let obj_id_4: ObjectID = serde_json::from_str(&format!("\"{}\"", hex)).unwrap();
let obj_id_5: ObjectID = serde_json::from_str(&format!("\"{}\"", long_hex)).unwrap();
let obj_id_6: ObjectID = serde_json::from_str(&format!("\"{}\"", long_hex_alt)).unwrap();
assert_eq!(SUI_FRAMEWORK_ADDRESS, obj_id_1.0);
assert_eq!(SUI_FRAMEWORK_ADDRESS, obj_id_2.0);
assert_eq!(SUI_FRAMEWORK_ADDRESS, obj_id_3.0);
assert_eq!(SUI_FRAMEWORK_ADDRESS, obj_id_4.0);
assert_eq!(SUI_FRAMEWORK_ADDRESS, obj_id_5.0);
assert_eq!(SUI_FRAMEWORK_ADDRESS, obj_id_6.0);
}

Should be allowed everywhere

@patrickkuo patrickkuo merged commit 7b45b07 into main May 10, 2022
@patrickkuo patrickkuo deleted the pat/0x_everywhere_doc branch May 10, 2022 16:48
longbowlu pushed a commit that referenced this pull request May 12, 2022
#1867)

* add 0x prefix and change SuiAddress and ObjectID to lowercase

* add 0x prefix and change SuiAddress and ObjectID to lowercase

* address Pr comment
punwai pushed a commit that referenced this pull request Jul 27, 2022
#1867)

* add 0x prefix and change SuiAddress and ObjectID to lowercase

* add 0x prefix and change SuiAddress and ObjectID to lowercase

* address Pr comment
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants