Skip to content
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

Slot to Epoch, and date to slot conversion #8

Merged
merged 7 commits into from
Jul 4, 2024

Conversation

nemo83
Copy link
Contributor

@nemo83 nemo83 commented May 14, 2024

Implementing slot to epoch conversion

[x] Shelley slot to epoch conversion
[x] Byron slot to epoch conversion

Implemented date to slot conversion
[x] Shelley date to slot conversion
[x] Byron date to slot conversion

@nemo83 nemo83 requested a review from matiwinnetou May 14, 2024 22:34
@nemo83 nemo83 force-pushed the feat/slot-to-epoch-conversion branch from 3a11a73 to 7ce62e1 Compare May 15, 2024 10:51
@@ -26,4 +27,14 @@ public LocalDateTime slotToTime(long absoluteSlot) {
// for now post byron we have 1 slot = 1 second
return genesisConfig.blockTime(EraType.Shelley, absoluteSlot);
}

public Long slotToEpoch(long absoluteSlot) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we somehow indicate that this is partial function in Java?

https://www.pgrs.net/2015/04/23/partial-function-application-in-java-8/

like if this is byron then function doesn't work right..

What do you think?

@nemo83 nemo83 changed the title Slot to Epoch conversion Slot to Epoch, and date to slot conversion Jul 4, 2024
@nemo83 nemo83 marked this pull request as ready for review July 4, 2024 15:05
@@ -0,0 +1,28 @@
package org.cardanofoundation.conversions.exceptioni;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why is package called in Italian? exceptioni?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it was a typo, it's eccezioni in italian, exceptioni it's just a typo

@nemo83 nemo83 merged commit b98d226 into main Jul 4, 2024
2 checks passed
@nemo83 nemo83 deleted the feat/slot-to-epoch-conversion branch July 4, 2024 17:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants