From 46b788756611db53f43354fc32814eb6fec1705f Mon Sep 17 00:00:00 2001 From: Mark Spanbroek Date: Tue, 10 Dec 2024 14:43:03 +0100 Subject: [PATCH] rename BlockId.new() -> BlockId.init() --- mysticeti.nim | 2 +- mysticeti/blocks/blockid.nim | 2 +- tests/mysticeti/examples.nim | 2 +- tests/mysticeti/mocks/blck.nim | 2 +- tests/mysticeti/validator/testValidatorNetwork.nim | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/mysticeti.nim b/mysticeti.nim index 1c6bdb1..8260936 100644 --- a/mysticeti.nim +++ b/mysticeti.nim @@ -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 diff --git a/mysticeti/blocks/blockid.nim b/mysticeti/blocks/blockid.nim index a45de6d..4894c5a 100644 --- a/mysticeti/blocks/blockid.nim +++ b/mysticeti/blocks/blockid.nim @@ -5,7 +5,7 @@ type BlockId*[Hash] = object round: uint64 hash: Hash -func new*[Hash]( +func init*[Hash]( _: type BlockId, author: CommitteeMember, round: uint64, diff --git a/tests/mysticeti/examples.nim b/tests/mysticeti/examples.nim index 4ffe160..f885898 100644 --- a/tests/mysticeti/examples.nim +++ b/tests/mysticeti/examples.nim @@ -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, diff --git a/tests/mysticeti/mocks/blck.nim b/tests/mysticeti/mocks/blck.nim index daefe34..c1d84bb 100644 --- a/tests/mysticeti/mocks/blck.nim +++ b/tests/mysticeti/mocks/blck.nim @@ -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 diff --git a/tests/mysticeti/validator/testValidatorNetwork.nim b/tests/mysticeti/validator/testValidatorNetwork.nim index 18bddc8..b97568a 100644 --- a/tests/mysticeti/validator/testValidatorNetwork.nim +++ b/tests/mysticeti/validator/testValidatorNetwork.nim @@ -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),