|
14 | 14 | // limitations under the License. |
15 | 15 | pragma solidity ^0.8.17; |
16 | 16 |
|
17 | | -import "./Codec.sol"; |
| 17 | +import {Codec} from "./Codec.sol"; |
| 18 | +import {Header, HeaderImpl} from "./Header.sol"; |
| 19 | +import { |
| 20 | + Vote, |
| 21 | + RelayChainProof, |
| 22 | + BeefyConsensusProof, |
| 23 | + Commitment, |
| 24 | + BeefyConsensusState, |
| 25 | + PartialBeefyMmrLeaf, |
| 26 | + Parachain, |
| 27 | + ParachainProof |
| 28 | +} from "./Types.sol"; |
18 | 29 | import {StateMachine} from "@hyperbridge/core/libraries/StateMachine.sol"; |
19 | 30 | import {IConsensus, IntermediateState, StateCommitment} from "@hyperbridge/core/interfaces/IConsensus.sol"; |
20 | 31 |
|
21 | 32 | import {MerkleMultiProof} from "@polytope-labs/solidity-merkle-trees/src/MerkleMultiProof.sol"; |
22 | 33 | import {MerkleMountainRange} from "@polytope-labs/solidity-merkle-trees/src/MerkleMountainRange.sol"; |
23 | 34 | import {MerklePatricia} from "@polytope-labs/solidity-merkle-trees/src/MerklePatricia.sol"; |
24 | | -import {StorageValue, MmrLeaf} from "@polytope-labs/solidity-merkle-trees/src/Types.sol"; |
| 35 | +import {Node, StorageValue, MmrLeaf} from "@polytope-labs/solidity-merkle-trees/src/Types.sol"; |
25 | 36 | import {ScaleCodec} from "@polytope-labs/solidity-merkle-trees/src/trie/substrate/ScaleCodec.sol"; |
26 | 37 | import {Bytes} from "@polytope-labs/solidity-merkle-trees/src/trie/Bytes.sol"; |
27 | 38 |
|
28 | 39 | import {ECDSA} from "@openzeppelin/contracts/utils/cryptography/ECDSA.sol"; |
29 | 40 | import {ERC165} from "@openzeppelin/contracts/utils/introspection/ERC165.sol"; |
30 | 41 |
|
31 | | -struct Vote { |
32 | | - // secp256k1 signature from a member of the authority set |
33 | | - bytes signature; |
34 | | - // This member's index in the set |
35 | | - uint256 authorityIndex; |
36 | | -} |
37 | | - |
38 | | -// The signed commitment holds a commitment to the latest |
39 | | -// finalized state as well as votes from a supermajority |
40 | | -// of the authority set which confirms this state |
41 | | -struct SignedCommitment { |
42 | | - // A commitment to the finalized state |
43 | | - Commitment commitment; |
44 | | - // The confirming votes |
45 | | - Vote[] votes; |
46 | | -} |
47 | | - |
48 | | -struct RelayChainProof { |
49 | | - // Signed commitment |
50 | | - SignedCommitment signedCommitment; |
51 | | - // Latest leaf added to mmr |
52 | | - BeefyMmrLeaf latestMmrLeaf; |
53 | | - // Proof for the latest mmr leaf |
54 | | - bytes32[] mmrProof; |
55 | | - // Proof for authorities in current/next session |
56 | | - Node[][] proof; |
57 | | -} |
58 | | - |
59 | | -struct BeefyConsensusProof { |
60 | | - // The proof items for the relay chain consensus |
61 | | - RelayChainProof relay; |
62 | | - // Proof items for parachain headers |
63 | | - ParachainProof parachain; |
64 | | -} |
65 | | - |
66 | 42 | /** |
67 | 43 | * @title The BEEFY Consensus Client. |
68 | 44 | * @author Polytope Labs (hello@polytope.technology) |
|
0 commit comments