-
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 remote-tracking branch 'origin/main' into discord
- Loading branch information
Showing
17 changed files
with
165 additions
and
148 deletions.
There are no files selected for viewing
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
36 changes: 0 additions & 36 deletions
36
...ices/voting-app/src/main/java/org/cardano/foundation/voting/config/ThreadPoolsConfig.java
This file was deleted.
Oops, something went wrong.
6 changes: 4 additions & 2 deletions
6
...ces/voting-app/src/main/java/org/cardano/foundation/voting/domain/L1MerkleCommitment.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 |
---|---|---|
@@ -1,9 +1,11 @@ | ||
package org.cardano.foundation.voting.domain; | ||
|
||
import org.cardano.foundation.voting.domain.entity.Vote; | ||
import org.cardano.foundation.voting.repository.VoteRepository; | ||
import org.cardanofoundation.merkle.MerkleElement; | ||
|
||
import java.util.List; | ||
|
||
// L1 Merkle commitment for an event | ||
public record L1MerkleCommitment(List<Vote> votes, MerkleElement<Vote> root, String eventId) { } | ||
public record L1MerkleCommitment(List<VoteRepository.CompactVote> signedVotes, | ||
MerkleElement<VoteRepository.CompactVote> root, | ||
String eventId) { } |
26 changes: 26 additions & 0 deletions
26
...ces/voting-app/src/main/java/org/cardano/foundation/voting/domain/VoteSerialisations.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,26 @@ | ||
package org.cardano.foundation.voting.domain; | ||
|
||
import org.cardano.foundation.voting.repository.VoteRepository; | ||
import org.cardanofoundation.cip30.CIP30Verifier; | ||
|
||
import java.util.Optional; | ||
import java.util.function.Function; | ||
|
||
import static com.bloxbean.cardano.client.crypto.Blake2bUtil.blake2bHash256; | ||
|
||
public final class VoteSerialisations { | ||
|
||
public static final Function<VoteRepository.CompactVote, byte[]> VOTE_SERIALISER = createSerialiserFunction(); | ||
|
||
public static Function<VoteRepository.CompactVote, byte[]> createSerialiserFunction() { | ||
return vote -> { | ||
var cip30Verifier = new CIP30Verifier(vote.getCoseSignature(), vote.getCosePublicKey()); | ||
var verificationResult = cip30Verifier.verify(); | ||
|
||
var bytes = Optional.ofNullable(verificationResult.getMessage()).orElse(new byte[0]); | ||
|
||
return blake2bHash256(bytes); | ||
}; | ||
} | ||
|
||
} |
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
22 changes: 10 additions & 12 deletions
22
...rvices/voting-app/src/main/java/org/cardano/foundation/voting/jobs/VoteCommitmentJob.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
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.