-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1182 from cardano-foundation/feat/MET-2055-update…
…-votes-section-dev-test chore: merge dev-test
- Loading branch information
Showing
11 changed files
with
400 additions
and
122 deletions.
There are no files selected for viewing
9 changes: 9 additions & 0 deletions
9
src/main/java/org/cardanofoundation/explorer/api/common/enumeration/ProtocolParamGroup.java
This file contains 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,9 @@ | ||
package org.cardanofoundation.explorer.api.common.enumeration; | ||
|
||
public enum ProtocolParamGroup { | ||
NETWORK, | ||
ECONOMIC, | ||
TECHNICAL, | ||
GOVERNANCE, | ||
SECURITY | ||
} |
This file contains 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 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
14 changes: 14 additions & 0 deletions
14
src/main/java/org/cardanofoundation/explorer/api/projection/VotingCCProjection.java
This file contains 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,14 @@ | ||
package org.cardanofoundation.explorer.api.projection; | ||
|
||
import org.cardanofoundation.explorer.common.entity.enumeration.Vote; | ||
|
||
public interface VotingCCProjection { | ||
|
||
String getTxHash(); | ||
|
||
Integer getIndex(); | ||
|
||
Vote getVote(); | ||
|
||
String getVoterHash(); | ||
} |
33 changes: 33 additions & 0 deletions
33
...cardanofoundation/explorer/api/repository/ledgersync/CommitteeRegistrationRepository.java
This file contains 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,33 @@ | ||
package org.cardanofoundation.explorer.api.repository.ledgersync; | ||
|
||
import java.util.List; | ||
|
||
import org.springframework.data.jpa.repository.JpaRepository; | ||
import org.springframework.data.jpa.repository.Query; | ||
import org.springframework.data.repository.query.Param; | ||
|
||
import org.cardanofoundation.explorer.api.projection.VotingCCProjection; | ||
import org.cardanofoundation.explorer.common.entity.compositeKey.CommitteeRegistrationId; | ||
import org.cardanofoundation.explorer.common.entity.ledgersync.CommitteeRegistration; | ||
|
||
public interface CommitteeRegistrationRepository | ||
extends JpaRepository<CommitteeRegistration, CommitteeRegistrationId> { | ||
@Query( | ||
value = | ||
"SELECT COUNT(cr) FROM CommitteeRegistration cr " | ||
+ "JOIN EpochParam ep ON cr.epoch = ep.epochNo " | ||
+ "WHERE (ep.epochNo + ep.committeeMaxTermLength) >= :expiredEpoch") | ||
Integer countByExpiredEpochNo(@Param("expiredEpoch") Integer expiredEpoch); | ||
|
||
@Query( | ||
value = | ||
""" | ||
select lvp.voterHash as voterHash, lvp.txHash as txHash, lvp.index as index, lvp.vote as vote from CommitteeRegistration cr | ||
left join LatestVotingProcedure lvp on lvp.govActionTxHash = :txHash | ||
and lvp.govActionIndex = :index and lvp.voterType = 'CONSTITUTIONAL_COMMITTEE_HOT_KEY_HASH' and lvp.voterHash = cr.hotKey | ||
where not exists ( select 1 from CommitteeRegistration cr2 where cr2.coldKey = cr.coldKey and cr2.blockTime > cr.blockTime) | ||
and not exists (select 1 from CommitteeDeRegistration cd where cd.coldKey = cr.coldKey and cd.blockTime > cr.blockTime) | ||
""") | ||
List<VotingCCProjection> findByTxHashAndIndex( | ||
@Param("txHash") String txHash, @Param("index") Integer index); | ||
} |
This file contains 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 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.