-
Notifications
You must be signed in to change notification settings - Fork 19
feat(shelley): created genesis pools from shelley genesis #1054
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
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: Jenita <jkawan@blinklabs.io>
Signed-off-by: Jenita <jkawan@blinklabs.io>
ledger/shelley/genesis.go
Outdated
@@ -128,6 +204,32 @@ func (g *ShelleyGenesis) GenesisUtxos() ([]common.Utxo, error) { | |||
return ret, nil | |||
} | |||
|
|||
// GetInitialPools returns all initial stake pools with their delegators | |||
func (g *ShelleyGenesis) GetInitialPools() (map[string]GenesisPool, map[string][]string, error) { |
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.
Drop the Get
prefix on the function. It's not idiomatic Go
ledger/shelley/genesis.go
Outdated
} | ||
|
||
// GetPoolById returns a specific pool by its ID along with its delegators | ||
func (g *ShelleyGenesis) GetPoolById(poolId string) (*GenesisPool, []string, error) { |
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.
Drop the Get
prefix on the function. It's not idiomatic Go
ledger/shelley/genesis.go
Outdated
@@ -128,6 +204,32 @@ func (g *ShelleyGenesis) GenesisUtxos() ([]common.Utxo, error) { | |||
return ret, nil | |||
} | |||
|
|||
// GetInitialPools returns all initial stake pools with their delegators | |||
func (g *ShelleyGenesis) GetInitialPools() (map[string]GenesisPool, map[string][]string, error) { |
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.
We should return native ledger types here like we do above for GenesisUtxos()
. At minimum, we should use common.Address
where appropriate.
Credential struct { | ||
KeyHash string `json:"key hash"` | ||
} `json:"credential"` | ||
Network string `json:"network"` | ||
} |
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.
There's a lot of overlap between these structures and common.PoolRegistrationCertificate
, common.PoolRelay
, and related types. We could probably merge them and avoid the need to convert/copy between them later.
ledger/shelley/genesis.go
Outdated
} | ||
|
||
// GetPoolById returns a specific pool by its ID along with its delegators | ||
func (g *ShelleyGenesis) GetPoolById(poolId string) (*GenesisPool, []string, error) { |
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.
This should return []common.Address
instead of []string
Signed-off-by: Jenita <jkawan@blinklabs.io>
Signed-off-by: Jenita <jkawan@blinklabs.io>
Signed-off-by: Jenita <jkawan@blinklabs.io>
Signed-off-by: Jenita <jkawan@blinklabs.io>
Signed-off-by: Jenita <jkawan@blinklabs.io>
Signed-off-by: Jenita <jkawan@blinklabs.io>
Signed-off-by: Jenita <jkawan@blinklabs.io>
Closes #1042