You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Channel IDs are 32-byte IDs, and are represented simply as [u8; 32] in LDK.
A new type could be introduced, as an abstraction of the channel ID type. This would be a refactoring.
Rationale:
better representation of a type representing a channel ID (abstraction)
potential for indicating when a channel ID is only temporary
Proposed change:
a ChannelId enum, with values for outpoint-based and temporary IDs (and later revocation-based), all wrapping [u8; 32].
Alternatives of increasing complexity / code change needed:
(current state) use native type [u8; 32]
a named type alias (type ChannelId = [u8; 32]). Can be used interchangebly.
a struct wrapping the native type, as 1-element tuple, struct ChannelId(pub [u8; 32])), similar to PaymentId. Construction and usage sites need slight modification.
a struct wrapping the data in a private field, with accessor and special construction methods.
an enum, with values for outpoint-based, temporary (and later revocation-based), all wrapping 32-byte array.
(not recommended) a trait and different implementations for different variants.
Channel IDs are 32-byte IDs, and are represented simply as
[u8; 32]in LDK.A new type could be introduced, as an abstraction of the channel ID type. This would be a refactoring.
Rationale:
Proposed change:
a
ChannelIdenum, with values for outpoint-based and temporary IDs (and later revocation-based), all wrapping[u8; 32].Alternatives of increasing complexity / code change needed:
[u8; 32]type ChannelId = [u8; 32]). Can be used interchangebly.struct ChannelId(pub [u8; 32])), similar toPaymentId. Construction and usage sites need slight modification.