Skip to content

Commit

Permalink
fixed comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Oleksandr committed Dec 20, 2024
1 parent 6f89cb8 commit e6f35a4
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

@Data
public class GrandpaConsensusMessage {
private long bestFinalizedBlock;
private BigInteger delayStartBlockNumber;
private List<Authority> authorities;
private BigInteger disabledAuthority;
private long delay;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import io.emeraldpay.polkaj.scale.reader.ListReader;
import io.emeraldpay.polkaj.scale.reader.UInt64Reader;

import java.math.BigInteger;
import java.util.List;

public class GrandpaConsensusMessageReader implements ScaleReader<GrandpaConsensusMessage> {
Expand All @@ -24,10 +25,10 @@ public GrandpaConsensusMessage read(ScaleCodecReader reader) {
grandpaConsensusMessage.setDelay(delay);
}
case GRANDPA_FORCED_CHANGE -> {
long bestFinalizedBlock = reader.readUint32();
long delayStartBlockNumber = reader.readUint32();
List<Authority> authorities = reader.read(new ListReader<>(new AuthorityReader()));
long delay = reader.readUint32();
grandpaConsensusMessage.setBestFinalizedBlock(bestFinalizedBlock);
grandpaConsensusMessage.setDelayStartBlockNumber(BigInteger.valueOf(delayStartBlockNumber));
grandpaConsensusMessage.setAuthorities(authorities);
grandpaConsensusMessage.setDelay(delay);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ void testForcedChangeInput() {
GrandpaConsensusMessage message = reader.read(new ScaleCodecReader(input));
assertNotNull(message);
assertEquals(GrandpaConsensusMessageFormat.GRANDPA_FORCED_CHANGE, message.getFormat());
assertEquals(3, message.getBestFinalizedBlock());
assertEquals(BigInteger.valueOf(3), message.getDelayStartBlockNumber());
assertNotNull(message.getAuthorities());

assertEquals(1, message.getAuthorities().size());
Expand Down

0 comments on commit e6f35a4

Please sign in to comment.