-
Notifications
You must be signed in to change notification settings - Fork 1
Add entities/stake_pools/v0 namespace and definitions #290
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
Merged
+117
−6
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
e0227bf
Update CIPs reference
joaosreis 557a48d
Add staking_keyhash and account_id rules
joaosreis 6db23e2
Add relay and pool_metadata rules
joaosreis 4f9f9a7
Add entities/stake_pools/v0 namespace and definitions
joaosreis 3658206
Add future_stake_pool_params to stake_pool definition and introduce s…
joaosreis 474124e
Refactor record_entry to correct keyhash definition for consistency
joaosreis File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
77 changes: 77 additions & 0 deletions
77
scls-cardano/cddl-src/Cardano/SCLS/Namespace/EntitiesStakePools.hs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,77 @@ | ||
| {-# LANGUAGE ImportQualifiedPost #-} | ||
| {-# LANGUAGE OverloadedLists #-} | ||
| {-# LANGUAGE OverloadedStrings #-} | ||
| {-# LANGUAGE QuasiQuotes #-} | ||
| {-# LANGUAGE TypeApplications #-} | ||
| {-# LANGUAGE NoImplicitPrelude #-} | ||
| {-# OPTIONS_GHC -Wno-unrecognised-pragmas #-} | ||
|
|
||
| {-# HLINT ignore "Use camelCase" #-} | ||
| module Cardano.SCLS.Namespace.EntitiesStakePools where | ||
|
|
||
| import Cardano.SCLS.Common | ||
| import Codec.CBOR.Cuddle.Huddle | ||
| import Data.Function (($)) | ||
| import Text.Heredoc (str) | ||
|
|
||
| record_entry :: Rule | ||
| record_entry = | ||
| comment | ||
| [str| The key for the namespace | ||
| | | ||
| | ``` | ||
| | meta: | ||
| | endian: be | ||
| | | ||
| | seq: | ||
| | - id: key | ||
| | type: keyhash | ||
| | | ||
| | types: | ||
| | keyhash: | ||
| | seq: | ||
| | - id: keyhash_data | ||
| | size: 28 | ||
| | ``` | ||
| |] | ||
| $ "record_entry" =:= stake_pool | ||
|
|
||
| stake_pool :: Rule | ||
| stake_pool = | ||
| "stake_pool" | ||
| =:= mp | ||
| [ "stake_pool_state" ==> stake_pool_state / VNil | ||
| , "retiring_epoch_no" ==> epoch_no / VNil | ||
| , "future_stake_pool_params" ==> stake_pool_params / VNil | ||
| ] | ||
|
|
||
| stake_pool_state :: Rule | ||
| stake_pool_state = | ||
| "stake_pool_state" | ||
| =:= mp | ||
| [ "vrf" ==> vrf_keyhash | ||
| , "cost" ==> coin | ||
| , "margin" ==> unit_interval | ||
| , "owners" ==> set staking_keyhash | ||
| , "pledge" ==> coin | ||
| , "relays" ==> arr [0 <+ a relay] | ||
| , "deposit" ==> coin | ||
| , "metadata" ==> pool_metadata / VNil | ||
| , "account_id" ==> account_id | ||
| , "delegators" ==> set credential | ||
| ] | ||
|
|
||
| stake_pool_params :: Rule | ||
| stake_pool_params = | ||
| "stake_pool_params" | ||
| =:= mp | ||
| [ "id" ==> pool_keyhash | ||
| , "vrf" ==> vrf_keyhash | ||
| , "cost" ==> coin | ||
| , "margin" ==> unit_interval | ||
| , "owners" ==> set staking_keyhash | ||
| , "pledge" ==> coin | ||
| , "relays" ==> arr [0 <+ a relay] | ||
| , "metadata" ==> pool_metadata / VNil | ||
| , "account_address" ==> address | ||
| ] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.