-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Separate types for UserApplicationId and ApplicationId. #3582
base: main
Are you sure you want to change the base?
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.
Will we need both types in the long run?
UserApplicationId, | ||
"A unique identifier for a user application" | ||
); | ||
// bcs_scalar!(UserApplicationId, "A unique identifier for a user application"); |
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.
Isn't that the same?
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.
Must have forgotten to remove it.
@@ -304,7 +304,45 @@ pub struct ApplicationId<A = ()> { | |||
|
|||
/// Alias for `ApplicationId`. Use this alias in the core |
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.
It's not an alias anymore.
They are used in different contexts:
Maybe we will be able to get rid of |
Motivation
We want to fix and expand our notion of
Address
(currentlyOwner
,GenericApplicationId
, etc.) to different type of addresses (32-byte Linera/Solana, 20-byte EVM). In order to do that we need to prepare the code for the introduction of new variants.Proposal
Add a separate type for
UserApplicationId(hash)
vsApplicationId
(a hash + type-safe ABI). Previously the presence ofA
type parameter in "address" enum made it more difficult to refactor. After this PR we have separate types for application's address and application with ABI (used mostly in tests and CLI now).Note: This is an alternative to #3570 . Where I kept the
UserApplicationId
name but promoted it to a newtype.Test Plan
CI should catch regressions.
Release Plan
Links