File tree 3 files changed +7
-7
lines changed
packages/cardano-services/src/ChainHistory/DbSyncChainHistory
3 files changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -93,14 +93,16 @@ const mapWithdrawals: (source: [{ credential: DbSyncCredential; network: string
93
93
const getGovernanceAction = ( {
94
94
denominator,
95
95
description,
96
- numerator,
97
- type
96
+ numerator
98
97
} : ProposalProcedureModel ) : Cardano . GovernanceAction => {
99
- const { contents } = description ;
98
+ const { contents, tag } = description ;
100
99
const governanceActionId =
101
100
contents && contents [ 0 ] ? { actionIndex : contents [ 0 ] . govActionIx , id : contents [ 0 ] . txId } : null ;
102
101
103
- switch ( type ) {
102
+ if ( ! tag ) throw new Error ( 'Missing "tag" in governance action proposal description' ) ;
103
+ if ( typeof tag !== 'string' ) throw new Error ( 'Wrong "tag" type in governance action proposal description' ) ;
104
+
105
+ switch ( tag ) {
104
106
case 'HardForkInitiation' :
105
107
return {
106
108
__typename : GovernanceActionType . hard_fork_initiation_action ,
@@ -159,7 +161,7 @@ const getGovernanceAction = ({
159
161
} ;
160
162
}
161
163
162
- throw new Error ( `Unknown GovernanceActionType '${ type } ' with description "${ JSON . stringify ( description ) } "` ) ;
164
+ throw new Error ( `Unknown GovernanceActionType '${ tag } ' with description "${ JSON . stringify ( description ) } "` ) ;
163
165
} ;
164
166
165
167
const getVoter = (
Original file line number Diff line number Diff line change @@ -222,7 +222,6 @@ export const findProposalProceduresByTxIds = `
222
222
tx.hash AS tx_id,
223
223
ga.deposit,
224
224
ga.description,
225
- ga.type,
226
225
va.url,
227
226
va.data_hash,
228
227
sa.view,
Original file line number Diff line number Diff line change @@ -137,7 +137,6 @@ export interface ProposalProcedureModel {
137
137
// eslint-disable-next-line @typescript-eslint/no-explicit-any
138
138
description : any ;
139
139
tx_id : Buffer ;
140
- type : string ;
141
140
url : string ;
142
141
view : string ;
143
142
// LW-9675
You can’t perform that action at this time.
0 commit comments