Plutonomicon / cardano-transaction-lib

A Purescript library for building smart contract transactions on Cardano
https://plutonomicon.github.io/cardano-transaction-lib/
MIT License
93 stars 50 forks source link

Deprecate `AbsSlot` in favour of `Slot` #632

Closed vvtran closed 2 years ago

vvtran commented 2 years ago

AbsSlot was originally added for Ogmios queries https://ogmios.dev/api/ see QueryResponse[eraSummaries] to see Integer[ 0 .. 18446744073709552000 ] whereas Slot is a newtype wrapper over BigNum - a Rust u64 with max value 18446744073709551615 after https://github.com/Plutonomicon/cardano-transaction-lib/pull/609, note the difference of 385. See https://github.com/Plutonomicon/cardano-transaction-lib/pull/609#discussion_r909516939 for a discussion.

We believe it would be best to just replace AbsSlot by Slot, despite this minor difference, even if it is imprecise, the slot number is so large that it should be acceptable. We should add a comment under the Ogmios queries that can potentially return 18446744073709552000 to explain this difference.

Furthermore, this is an unnecessary duplicate type and we don't want to propagate AbsSlot into any further functions, especially if they're exposed in Contract, in this case, Slot should be preferred.

vvtran commented 2 years ago

Closed by https://github.com/Plutonomicon/cardano-transaction-lib/pull/643