File tree Expand file tree Collapse file tree 7 files changed +16
-0
lines changed
cardano-services/src/ChainHistory/DbSyncChainHistory
CardanoNode/__snapshots__
ogmiosToCore/__snapshots__ Expand file tree Collapse file tree 7 files changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -492,6 +492,7 @@ export const mapBlock = (
492492 : Cardano . SlotLeader ( blockModel . slot_leader_hash . toString ( 'hex' ) ) ,
493493 totalOutput : BigInt ( blockOutputModel ?. output ?? 0 ) ,
494494 txCount : Number ( blockModel . tx_count ) ,
495+ type : blockModel . type ,
495496 vrf : blockModel . vrf as unknown as Cardano . VrfVkBech32
496497} ) ;
497498
Original file line number Diff line number Diff line change @@ -19,6 +19,7 @@ export interface BlockModel {
1919 slot_no : string ;
2020 time : string ;
2121 tx_count : string ;
22+ type : Cardano . BlockType ;
2223 vrf : string ;
2324}
2425
Original file line number Diff line number Diff line change @@ -77,6 +77,8 @@ VrfVkBech32.fromHex = (value: string) => {
7777 return VrfVkBech32 ( BaseEncoding . bech32 . encode ( 'vrf_vk' , words , 1023 ) ) ;
7878} ;
7979
80+ export type BlockType = 'bft' | 'praos' ;
81+
8082/** Minimal Block type meant as a base for the more complete version `Block` */
8183// TODO: optionals (except previousBlock) are there because they are not calculated for Byron yet.
8284// Remove them once calculation is done and remove the Required<BlockMinimal> from interface Block
@@ -89,6 +91,7 @@ export interface BlockInfo {
8991 /** Byron blocks size not calculated yet */
9092 size ?: BlockSize ;
9193 previousBlock ?: BlockId ;
94+ type : BlockType ;
9295 vrf ?: VrfVkBech32 ;
9396 /**
9497 * This is the operational cold verification key of the stake pool
Original file line number Diff line number Diff line change @@ -11,6 +11,7 @@ import { PlutusData } from './PlutusData';
1111import { ProposalProcedure , VotingProcedures } from './Governance' ;
1212import { RewardAccount } from '../Address' ;
1313import { Script } from './Script' ;
14+ import { Serialization } from '../..' ;
1415
1516/** transaction hash as hex string */
1617export type TransactionId = OpaqueString < 'TransactionId' > ;
@@ -151,6 +152,7 @@ export interface OnChainTx<TBody extends TxBody = TxBody>
151152 extends Omit < TxWithInputSource < TBody > , 'witness' | 'auxiliaryData' > {
152153 witness : Omit < Witness , 'scripts' > ;
153154 auxiliaryData ?: Omit < AuxiliaryData , 'scripts' > ;
155+ cbor ?: Serialization . TxCBOR ;
154156}
155157
156158export interface HydratedTx extends TxWithInputSource < HydratedTxBody > {
Original file line number Diff line number Diff line change @@ -74,6 +74,7 @@ const mapByronBlock = (block: Schema.BlockBFT): Cardano.Block => ({
7474 size : mapBlockSize ( block ) ,
7575 totalOutput : mapTotalOutputs ( block ) ,
7676 txCount : mapTxCount ( block ) ,
77+ type : block . type ,
7778 vrf : undefined // no vrf key for byron. DbSync doesn't have one either
7879} ) ;
7980
@@ -86,6 +87,7 @@ const mapCommonBlock = (block: CommonBlock): Cardano.Block => ({
8687 size : mapBlockSize ( block ) ,
8788 totalOutput : mapTotalOutputs ( block ) ,
8889 txCount : mapTxCount ( block ) ,
90+ type : block . type ,
8991 vrf : mapCommonVrf ( block )
9092} ) ;
9193
Original file line number Diff line number Diff line change @@ -258,6 +258,7 @@ Array [
258258 " size" : 1880 ,
259259 " totalOutput" : 29999998493561943n ,
260260 " txCount" : 1 ,
261+ " type" : " praos" ,
261262 " vrf" : " vrf_vk1ny8dyz3pa9u7v7h8l5evsmxxjq07dk6j5uda60lxe3zsya5ea20s2c6jph" ,
262263 },
263264 " eventType" : 0 ,
Original file line number Diff line number Diff line change @@ -632,6 +632,7 @@ Object {
632632 " size" : 8511 ,
633633 " totalOutput" : 29698651346n ,
634634 " txCount" : 6 ,
635+ " type" : " praos" ,
635636 " vrf" : " vrf_vk1afy7gefvgc9eaek64lhunxw2velmuh4467n6a2aalah7r8q68j0s4f2sa9" ,
636637}
637638` ;
@@ -711,6 +712,7 @@ Object {
711712 " size" : 1193 ,
712713 " totalOutput" : 29699998493147869n ,
713714 " txCount" : 1 ,
715+ " type" : " praos" ,
714716 " vrf" : " vrf_vk1wpa9axwwassnadt8drdrzptxm285latvhhvsgv0t6zhp0akgej9sfgecvl" ,
715717}
716718` ;
@@ -790,6 +792,7 @@ Object {
790792 " size" : 1152 ,
791793 " totalOutput" : 29699998492735907n ,
792794 " txCount" : 1 ,
795+ " type" : " praos" ,
793796 " vrf" : " vrf_vk1aw6s04lqkquell8drg6jjusrzd8c5259kctvxkgug5kta7nphz9qfqtr4w" ,
794797}
795798` ;
@@ -846,6 +849,7 @@ Object {
846849 " size" : 908 ,
847850 " totalOutput" : 1000000n ,
848851 " txCount" : 1 ,
852+ " type" : " bft" ,
849853 " vrf" : undefined ,
850854}
851855` ;
@@ -925,6 +929,7 @@ Object {
925929 " size" : 1151 ,
926930 " totalOutput" : 29699998492941888n ,
927931 " txCount" : 1 ,
932+ " type" : " praos" ,
928933 " vrf" : " vrf_vk1aw6s04lqkquell8drg6jjusrzd8c5259kctvxkgug5kta7nphz9qfqtr4w" ,
929934}
930935` ;
@@ -1157,6 +1162,7 @@ Object {
11571162 " size" : 1880 ,
11581163 " totalOutput" : 29999998493561943n ,
11591164 " txCount" : 1 ,
1165+ " type" : " praos" ,
11601166 " vrf" : " vrf_vk1ny8dyz3pa9u7v7h8l5evsmxxjq07dk6j5uda60lxe3zsya5ea20s2c6jph" ,
11611167}
11621168` ;
You can’t perform that action at this time.
0 commit comments