-
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.
Beefy data structure definition and implementation
- Loading branch information
Oleksandr
committed
Feb 21, 2025
1 parent
b49067b
commit 981363b
Showing
6 changed files
with
73 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package com.limechain.beefy.dto; | ||
|
||
import lombok.Data; | ||
|
||
import java.math.BigInteger; | ||
import java.util.List; | ||
|
||
@Data | ||
public class Commitment { | ||
private List<PayloadElement> payload; | ||
private BigInteger blockNumber; | ||
private BigInteger validatorSetId; | ||
} |
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 com.limechain.beefy.dto; | ||
|
||
import lombok.Data; | ||
|
||
@Data | ||
public class PayloadElement { | ||
private byte[] payloadId; | ||
private byte[] data; | ||
} |
13 changes: 13 additions & 0 deletions
13
src/main/java/com/limechain/beefy/dto/SignedCommitment.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,13 @@ | ||
package com.limechain.beefy.dto; | ||
|
||
import com.limechain.runtime.hostapi.dto.Signature; | ||
import lombok.Data; | ||
|
||
import java.util.List; | ||
import java.util.Optional; | ||
|
||
@Data | ||
public class SignedCommitment { | ||
private Commitment commitment; | ||
private List<Optional<Signature>> signature; | ||
} |
13 changes: 13 additions & 0 deletions
13
src/main/java/com/limechain/beefy/dto/SignedCommitmentWitness.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,13 @@ | ||
package com.limechain.beefy.dto; | ||
|
||
import com.limechain.runtime.hostapi.dto.Signature; | ||
import lombok.Data; | ||
|
||
import java.util.List; | ||
|
||
@Data | ||
public class SignedCommitmentWitness { | ||
private Commitment commitment; | ||
private List<Boolean> signedBy; | ||
private Signature signature; | ||
} |
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,12 @@ | ||
package com.limechain.beefy.dto; | ||
|
||
import io.libp2p.core.crypto.PubKey; | ||
import lombok.Data; | ||
|
||
import java.util.List; | ||
|
||
@Data | ||
public class ValidatorSet { | ||
List<PubKey> validators; | ||
private long id; | ||
} |
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,13 @@ | ||
package com.limechain.beefy.dto; | ||
|
||
import com.limechain.runtime.hostapi.dto.Signature; | ||
import lombok.Data; | ||
|
||
import java.math.BigInteger; | ||
|
||
@Data | ||
public class VoteMessage { | ||
private Commitment commitment; | ||
private BigInteger authorityId; | ||
private Signature signature; | ||
} |