mirror of
https://github.com/sigp/lighthouse.git
synced 2026-04-30 03:03:45 +00:00
Add BooleanBitfield struct
This commit is contained in:
@@ -20,7 +20,7 @@ impl ActiveState {
|
||||
Self {
|
||||
height: 0,
|
||||
randao: Sha256Digest::zero(),
|
||||
ffg_voter_bitfield: Vec::new(),
|
||||
ffg_voter_bitfield: Bitfield::new(),
|
||||
recent_attesters: Vec::new(),
|
||||
partial_crosslinks: Vec::new(),
|
||||
total_skip_count: 0,
|
||||
@@ -96,11 +96,11 @@ mod tests {
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_serialization() {
|
||||
fn test_rlp_serialization() {
|
||||
let a = ActiveState {
|
||||
height: 100,
|
||||
randao: Sha256Digest::zero(),
|
||||
ffg_voter_bitfield: Vec::new(),
|
||||
ffg_voter_bitfield: Bitfield::new(),
|
||||
recent_attesters: Vec::new(),
|
||||
partial_crosslinks: Vec::new(),
|
||||
total_skip_count: 99,
|
||||
|
||||
@@ -14,7 +14,7 @@ impl AggregateVote {
|
||||
Self {
|
||||
shard_id: 0,
|
||||
shard_block_hash: Sha256Digest::zero(),
|
||||
notary_bitfield: Vec::new(),
|
||||
notary_bitfield: Bitfield::new(),
|
||||
aggregate_sig: AggregateSignature::new()
|
||||
}
|
||||
}
|
||||
@@ -46,11 +46,11 @@ mod tests {
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_serialization() {
|
||||
fn test_rlp_serialization() {
|
||||
let a = AggregateVote {
|
||||
shard_id: 100,
|
||||
shard_block_hash: Sha256Digest::zero(),
|
||||
notary_bitfield: Vec::new(),
|
||||
notary_bitfield: Bitfield::new(),
|
||||
aggregate_sig: AggregateSignature::new()
|
||||
};
|
||||
let e = rlp::encode(&a);
|
||||
|
||||
@@ -23,7 +23,7 @@ impl Block {
|
||||
parent_hash: parent_hash,
|
||||
skip_count: 0,
|
||||
randao_reveal: randao_reveal,
|
||||
attestation_bitfield: Vec::new(),
|
||||
attestation_bitfield: Bitfield::new(),
|
||||
attestation_aggregate_sig: AggregateSignature::new(),
|
||||
shard_aggregate_votes: Vec::new(),
|
||||
main_chain_ref: main_chain_ref,
|
||||
@@ -147,12 +147,12 @@ mod tests {
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_serialization() {
|
||||
fn test_rlp_serialization() {
|
||||
let b = Block {
|
||||
parent_hash: Sha256Digest::zero(),
|
||||
skip_count: 100,
|
||||
randao_reveal: Sha256Digest::zero(),
|
||||
attestation_bitfield: Vec::new(),
|
||||
attestation_bitfield: Bitfield::new(),
|
||||
attestation_aggregate_sig: AggregateSignature::new(),
|
||||
shard_aggregate_votes: Vec::new(),
|
||||
main_chain_ref: Sha256Digest::zero(),
|
||||
|
||||
@@ -40,7 +40,7 @@ mod tests {
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_serialization() {
|
||||
fn test_rlp_serialization() {
|
||||
let c = CrosslinkRecord {
|
||||
epoch: 100,
|
||||
hash: Sha256Digest::zero()
|
||||
|
||||
@@ -92,7 +92,7 @@ mod tests {
|
||||
use super::*;
|
||||
|
||||
#[test]
|
||||
fn test_serialization() {
|
||||
fn test_rlp_serialization() {
|
||||
let a = CrystallizedState {
|
||||
active_validators: Vec::new(),
|
||||
queued_validators: Vec::new(),
|
||||
|
||||
@@ -13,7 +13,7 @@ impl PartialCrosslinkRecord {
|
||||
PartialCrosslinkRecord {
|
||||
shard_id: shard_id,
|
||||
shard_block_hash: shard_block_hash,
|
||||
voter_bitfield: Vec::new()
|
||||
voter_bitfield: Bitfield::new()
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -45,11 +45,11 @@ mod tests {
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_serialization() {
|
||||
fn test_rlp_serialization() {
|
||||
let p = PartialCrosslinkRecord {
|
||||
shard_id: 1,
|
||||
shard_block_hash: Sha256Digest::zero(),
|
||||
voter_bitfield: Vec::new()
|
||||
voter_bitfield: Bitfield::new()
|
||||
};
|
||||
let e = rlp::encode(&p);
|
||||
assert_eq!(e.len(), 35);
|
||||
|
||||
@@ -37,7 +37,7 @@ mod tests {
|
||||
use super::*;
|
||||
|
||||
#[test]
|
||||
fn test_serialization() {
|
||||
fn test_rlp_serialization() {
|
||||
let index = 1;
|
||||
let randao_commitment = Sha256Digest::zero();
|
||||
let balance_delta = 99;
|
||||
|
||||
@@ -81,7 +81,7 @@ mod tests {
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_serialization() {
|
||||
fn test_rlp_serialization() {
|
||||
let keypair = get_dangerous_test_keypair();
|
||||
let v = ValidatorRecord {
|
||||
pubkey: keypair.public,
|
||||
|
||||
Reference in New Issue
Block a user