-
Notifications
You must be signed in to change notification settings - Fork 28
Add NTN CDDLs #1422
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: js/delete-deprecate-query
Are you sure you want to change the base?
Add NTN CDDLs #1422
Changes from all commits
30e74d1
7be68e2
0f3c292
19147ef
0d0a3d1
c7543ef
a29b4dc
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
telescope7<byron, shelley, allegra, mary, alonzo, babbage, conway> | ||
= [pastEra, pastEra, pastEra, pastEra, pastEra, pastEra, currentEra<conway>] / | ||
[pastEra, pastEra, pastEra, pastEra, pastEra, currentEra<babbage>] / | ||
[pastEra, pastEra, pastEra, pastEra, currentEra<alonzo>] / | ||
[pastEra, pastEra, pastEra, currentEra<mary>] / | ||
[pastEra, pastEra, currentEra<allegra>] / | ||
[pastEra, currentEra<shelley>] / | ||
[currentEra<byron>] | ||
|
||
ns7<byron, shelley, allegra, mary, alonzo, babbage, conway> | ||
= [6, conway] / | ||
[5, babbage] / | ||
[4, alonzo] / | ||
[3, mary] / | ||
[2, allegra] / | ||
[1, shelley] / | ||
[0, byron] | ||
|
||
;; Blockchain types | ||
pastEra = [bound, bound] | ||
currentEra<st> = [bound, st] | ||
bound = [relativeTime, slotno, epochno] | ||
eraIdx = word8 | ||
individualPoolStake = [stake, hash] | ||
nonce = [0] / [1, hash] | ||
point = [] / [ slotno, hash ] | ||
poolDistr = map<keyhash, individualPoolStake> | ||
slotno = word64 | ||
stake = rational | ||
|
||
withOrigin<v> = [] / [v] | ||
|
||
;; Collections | ||
either<x, y> = [0, x] / [1, y] | ||
map<x, y> = { * x => y } | ||
maybe<x> = [] / [x] | ||
seq<x> = [*23 x] / [24* x] ; encoded with indefinite-length encoding | ||
set<x> = #6.258([* x]) | ||
|
||
;; Types from other packages | ||
blockno = word64 | ||
epochno = word64 | ||
coin = word64 | ||
rational = [int, int] | ||
keyhash = bstr .size 28 | ||
hash = bstr .size 32 | ||
relativeTime = int | ||
|
||
;; Base word types | ||
word8 = uint .size 1 | ||
word32 = uint .size 4 | ||
word64 = uint .size 8 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
serialisedCardanoBlock = #6.24(bytes .cbor cardanoBlock) | ||
|
||
cardanoBlock = byron.block | ||
/ [2, shelley.block] | ||
/ [3, allegra.block] | ||
/ [4, mary.block] | ||
/ [5, alonzo.block] | ||
/ [6, babbage.block] | ||
/ [7, conway.block] | ||
|
||
;# import byron as byron | ||
;# import shelley as shelley | ||
;# import allegra as allegra | ||
;# import mary as mary | ||
;# import alonzo as alonzo | ||
;# import babbage as babbage | ||
;# import conway as conway |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
header | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This a comment that applies to each file: do we want to state where the corresponding Haskell data definition lives? And conversely, when defining a CBOR instance, would it make sense to define where the CDDL a CBOR instance conforms to is located? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
I don't think so. Eventually these files will go to the blueprint so there is no need there for a Haskell link.
Perhaps? |
||
= base.ns7<byronHeader, | ||
serialisedShelleyHeader<shelley.header>, | ||
serialisedShelleyHeader<allegra.header>, | ||
serialisedShelleyHeader<mary.header>, | ||
serialisedShelleyHeader<alonzo.header>, | ||
serialisedShelleyHeader<babbage.header>, | ||
serialisedShelleyHeader<conway.header>> | ||
|
||
byronHeader = [byronRegularIdx, #6.24(bytes .cbor byron.blockhead)] | ||
/ [byronBoundaryIdx, #6.24(bytes .cbor byron.ebbhead)] | ||
|
||
byronBoundaryIdx = [0, base.word32] | ||
byronRegularIdx = [1, base.word32] | ||
|
||
serialisedShelleyHeader<era> = #6.24(bytes .cbor era) | ||
|
||
;# include byron as byron | ||
;# include shelley as shelley | ||
;# include allegra as allegra | ||
;# include mary as mary | ||
;# include alonzo as alonzo | ||
;# include babbage as babbage | ||
;# include conway as conway | ||
;# import base as base |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
tx = | ||
base.ns7<byron.tx, | ||
serialisedShelleyTx<shelley.transaction>, | ||
serialisedShelleyTx<allegra.transaction>, | ||
serialisedShelleyTx<mary.transaction>, | ||
serialisedShelleyTx<alonzo.transaction>, | ||
serialisedShelleyTx<babbage.transaction>, | ||
serialisedShelleyTx<conway.transaction>> | ||
|
||
serialisedShelleyTx<era> = #6.24(bytes .cbor era) | ||
|
||
;# include byron as byron | ||
;# include shelley as shelley | ||
;# include allegra as allegra | ||
;# include mary as mary | ||
;# include alonzo as alonzo | ||
;# include babbage as babbage | ||
;# include conway as conway | ||
;# import base as base |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
txId = | ||
base.ns7<byronTxId, | ||
shelley.transaction_id, | ||
allegra.transaction_id, | ||
mary.transaction_id, | ||
alonzo.transaction_id, | ||
conway.transaction_id, | ||
babbage.transaction_id> | ||
|
||
byronTxId = [0, byron.txid] | ||
/ [1, byron.certificateid] | ||
/ [2, byron.updid] | ||
/ [3, byron.voteid] | ||
|
||
;# include byron as byron | ||
;# include shelley as shelley | ||
;# include allegra as allegra | ||
;# include mary as mary | ||
;# include alonzo as alonzo | ||
;# include babbage as babbage | ||
;# include conway as conway | ||
;# import base as base |
Uh oh!
There was an error while loading. Please reload this page.