Skip to content

Commit

Permalink
feat: tweak SendTransactionsProof message to support ckb2023
Browse files Browse the repository at this point in the history
  • Loading branch information
quake committed Oct 26, 2023
1 parent 1a7bfad commit c42e6ea
Show file tree
Hide file tree
Showing 5 changed files with 484 additions and 13 deletions.
20 changes: 20 additions & 0 deletions util/gen-types/schemas/extensions.mol
Original file line number Diff line number Diff line change
Expand Up @@ -416,6 +416,26 @@ table SendTransactionsProof {
missing_tx_hashes: Byte32Vec,
}

table SendTransactionsProofV1 {
// Refer to `SendLastStateProof.last_header`.
last_header: VerifiableHeader,
// Refer to `SendLastStateProof.proof`.
proof: HeaderDigestVec,

// A collection of filtered blocks, which include all requested
// transactions, and be verified in the proof.
filtered_blocks: FilteredBlockVec,

// Transaction hashes for the blocks which were not found.
missing_tx_hashes: Byte32Vec,

// Uncle hashes for the blocks which require verifying.
blocks_uncles_hash: Byte32Vec,

// Block extension for the blocks which require verifying.
blocks_extension: BytesOptVec,
}

/* Types for Network/Others */

table Time {
Expand Down
8 changes: 8 additions & 0 deletions util/gen-types/src/extension/shortcut.rs
Original file line number Diff line number Diff line change
Expand Up @@ -303,3 +303,11 @@ impl From<packed::SendBlocksProofV1> for packed::LightClientMessageUnion {
))
}
}

impl From<packed::SendTransactionsProofV1> for packed::LightClientMessageUnion {
fn from(item: packed::SendTransactionsProofV1) -> Self {
packed::LightClientMessageUnion::SendTransactionsProof(
packed::SendTransactionsProof::new_unchecked(item.as_bytes()),
)
}
}
Loading

0 comments on commit c42e6ea

Please sign in to comment.