Sui, a next-generation smart contract platform with high throughput, low latency, and an asset-oriented programming model powered by the Move programming language
Issue: Why is crate::sui_types::id::UID::new not const?
It should be const fn because ObjectID and AccountAddress can be constructed in const context and UID is a wrapper around ObjectID, hence it must be able to be constructed in the const context.
Furthermore, it appears in crate::sui_types::coin::CoinMetadata struct, and since it is 'metadata', it should be able to be constructed in const context too!
https://github.com/MystenLabs/sui/blob/69d3653419174917d8ffe667f230609970f9a544/crates/sui-types/src/id.rs#L38
Issue: Why is
crate::sui_types::id::UID::new
notconst
?It should be
const fn
becauseObjectID
andAccountAddress
can be constructed inconst
context andUID
is a wrapper aroundObjectID
, hence it must be able to be constructed in theconst
context.Furthermore, it appears in
crate::sui_types::coin::CoinMetadata
struct, and since it is 'metadata', it should be able to be constructed inconst
context too!