-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(check-misbehavior): implement hash function for header comparison
- Loading branch information
1 parent
b50cf5c
commit f8ff6be
Showing
4 changed files
with
197 additions
and
11 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
32 changes: 32 additions & 0 deletions
32
cardano/lib/ibc/client/ics-007-tendermint-client/cometbft/protos/types_pb.ak
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 |
---|---|---|
@@ -0,0 +1,32 @@ | ||
use aiken/builtin.{if_then_else as ite} | ||
use aiken/bytearray.{concat, push} | ||
use aiken/option.{is_none} | ||
use ibc/utils/bytes.{encode_varint} | ||
use ibc/utils/int.{uint64} | ||
|
||
pub type Consensus { | ||
block: Int, | ||
app: Int, | ||
} | ||
|
||
pub fn marshal_for_consensus(consensus_opt: Option<Consensus>) -> ByteArray { | ||
ite( | ||
is_none(consensus_opt), | ||
#[], | ||
{ | ||
expect Some(consensus) = consensus_opt | ||
let Consensus { block, app } = consensus | ||
#[] | ||
|> concat( | ||
ite( | ||
block == 0, | ||
#[], | ||
block |> uint64() |> encode_varint() |> push(8), | ||
), | ||
) | ||
|> concat( | ||
ite(app == 0, #[], app |> uint64() |> encode_varint() |> push(0x10)), | ||
) | ||
}, | ||
) | ||
} |
5 changes: 0 additions & 5 deletions
5
cardano/lib/ibc/client/ics-007-tendermint-client/cometbft/version/consensus.ak
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,6 +1 @@ | ||
pub const block_protocol = 11 | ||
|
||
pub type Consensus { | ||
block: Int, | ||
app: Int, | ||
} |
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