rename BlockId.new() -> BlockId.init()

This commit is contained in:
Mark Spanbroek 2024-12-10 14:43:03 +01:00
parent 1830b8f99e
commit 46b7887566
5 changed files with 5 additions and 5 deletions

View File

@ -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

View File

@ -5,7 +5,7 @@ type BlockId*[Hash] = object
round: uint64
hash: Hash
func new*[Hash](
func init*[Hash](
_: type BlockId,
author: CommitteeMember,
round: uint64,

View File

@ -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,

View File

@ -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

View File

@ -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),