-
Notifications
You must be signed in to change notification settings - Fork 234
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: introduce validator client (#7854)
- Loading branch information
Showing
72 changed files
with
1,424 additions
and
263 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -105,6 +105,7 @@ | |
"fuzzers", | ||
"gitmodules", | ||
"gitrepo", | ||
"Gossipable", | ||
"gossipsub", | ||
"grumpkin", | ||
"gtest", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -54,6 +54,9 @@ | |
{ | ||
"path": "../types" | ||
}, | ||
{ | ||
"path": "../validator-client" | ||
}, | ||
{ | ||
"path": "../world-state" | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 17 additions & 11 deletions
28
yarn-project/circuit-types/src/p2p/block_attestation.test.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,28 @@ | ||
// Serde test for the block attestation type | ||
import { makeHeader } from '@aztec/circuits.js/testing'; | ||
|
||
import { BlockAttestation } from './block_attestation.js'; | ||
|
||
const makeBlockAttestation = (): BlockAttestation => { | ||
const blockHeader = makeHeader(1); | ||
const signature = Buffer.alloc(64, 1); | ||
|
||
return new BlockAttestation(blockHeader, signature); | ||
}; | ||
import { makeBlockAttestation, randomSigner } from './mocks.js'; | ||
|
||
describe('Block Attestation serialization / deserialization', () => { | ||
it('Should serialize / deserialize', () => { | ||
const attestation = makeBlockAttestation(); | ||
it('Should serialize / deserialize', async () => { | ||
const attestation = await makeBlockAttestation(); | ||
|
||
const serialized = attestation.toBuffer(); | ||
const deserialized = BlockAttestation.fromBuffer(serialized); | ||
|
||
expect(deserialized).toEqual(attestation); | ||
}); | ||
|
||
it('Should serialize / deserialize + recover sender', async () => { | ||
const account = randomSigner(); | ||
|
||
const proposal = await makeBlockAttestation(account); | ||
const serialized = proposal.toBuffer(); | ||
const deserialized = BlockAttestation.fromBuffer(serialized); | ||
|
||
expect(deserialized).toEqual(proposal); | ||
|
||
// Recover signature | ||
const sender = await deserialized.getSender(); | ||
expect(sender.toChecksumString()).toEqual(account.address); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.