mirror of
https://github.com/logos-storage/nim-mysticeti.git
synced 2026-01-07 16:13:11 +00:00
rename BlockId.new() -> BlockId.init()
This commit is contained in:
parent
1830b8f99e
commit
46b7887566
@ -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
|
||||
|
||||
@ -5,7 +5,7 @@ type BlockId*[Hash] = object
|
||||
round: uint64
|
||||
hash: Hash
|
||||
|
||||
func new*[Hash](
|
||||
func init*[Hash](
|
||||
_: type BlockId,
|
||||
author: CommitteeMember,
|
||||
round: uint64,
|
||||
|
||||
@ -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,
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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),
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user