Skip to content

Commit

Permalink
rename BlockId.new() -> BlockId.init()
Browse files Browse the repository at this point in the history
markspanbroek committed Dec 10, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
1 parent 1830b8f commit 46b7887
Showing 5 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion mysticeti.nim
Original file line number Diff line number Diff line change
@@ -37,7 +37,7 @@ export committee.`$`
import ./mysticeti/blocks

export blocks.BlockId
export blocks.new
export blocks.init
export blocks.author
export blocks.round
export blocks.hash
2 changes: 1 addition & 1 deletion mysticeti/blocks/blockid.nim
Original file line number Diff line number Diff line change
@@ -5,7 +5,7 @@ type BlockId*[Hash] = object
round: uint64
hash: Hash

func new*[Hash](
func init*[Hash](
_: type BlockId,
author: CommitteeMember,
round: uint64,
2 changes: 1 addition & 1 deletion tests/mysticeti/examples.nim
Original file line number Diff line number Diff line change
@@ -14,7 +14,7 @@ proc example*(T: type BlockId): T =
let author = CommitteeMember.example
let round = uint64.example
let hash = T.Hash.example
BlockId.new(author, round, hash)
BlockId.init(author, round, hash)

proc example*(
T: type SignedBlock,
2 changes: 1 addition & 1 deletion tests/mysticeti/mocks/blck.nim
Original file line number Diff line number Diff line change
@@ -28,6 +28,6 @@ func id*(blck: MockBlock): auto =
without var id =? blck.id:
let blockBytes = cast[seq[byte]]($blck[])
let blockHash = MockHash.hash(blockBytes)
id = BlockId.new(blck.author, blck.round, blockHash)
id = BlockId.init(blck.author, blck.round, blockHash)
blck.id = some id
id
2 changes: 1 addition & 1 deletion tests/mysticeti/validator/testValidatorNetwork.nim
Original file line number Diff line number Diff line change
@@ -73,7 +73,7 @@ suite "Validator Network":
test "refuses proposals that have a parent that is not from a previous round":
let parents = (!simulator.exchangeProposals()).mapIt(it.blck.id)
let badParentRound = 1'u64
let badParent = BlockId.new(CommitteeMember(0), badParentRound, Hash.example)
let badParent = BlockId.init(CommitteeMember(0), badParentRound, Hash.example)
simulator.nextRound()
let blck = Block.new(
CommitteeMember(0),

0 comments on commit 46b7887

Please sign in to comment.