-
Notifications
You must be signed in to change notification settings - Fork 11.4k
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
Unify the size of SuiAddress and ObjectID (also move AccountAddress) #540
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Love it! The tiny changes, like the AccountAddress::from
instances, are super nice and more maintainable.
Hugely in favor of removing |
@@ -582,7 +582,7 @@ async fn test_handle_move_transaction() { | |||
|
|||
// Check that gas is properly deducted. | |||
// If the number changes, we want to verify that the change is intended. | |||
let gas_cost = 62; | |||
let gas_cost = 53; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
where do we get this number from?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I manually looked at the gas used.
Love that SuiAddress is no longer Vec! |
…ytes This changes from Addresses on 32 bytes.
There is no situation where the `TryFrom<&[u8]>` isn't more flexible and preferred.
ObjectID
and MoveAccountAddress
have been 20 bytes, whileSuiAddress
has been 32 bytes.This difference in size made it impossible to use the native
address
Move type to representSuiAddress
. We have been using a custom definedAddress
wrapper of raw bytes to representSuiAddress
.Now that we are aligned that
SuiAddress
and MoveAccountAddress
can be the same length, this PR aligns them and removes theAddress
type from Sui framework. (See #519)Specifically, this PR does the following:
Address.move
, which removes bothAddress
type andSigner
type from the framework. All uses are replaced with the native typeaddress
andsigner
.AccountAddress
type.new_signer_from_address
to create a signer from an address, for testing purpose only.A few TODOs left:
IDBytes
from Sui Move framework, as it's now just a wrapper ofaddress
.ObjectID
,AccountAddress
,SuiAddress
. The conversion logic is getting a bit messy. There is probably some cleanup we could do there.