Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ds/validate event test #297

Merged
merged 9 commits into from
Dec 20, 2024
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 10 additions & 7 deletions contracts/libs/Ibc.sol
Original file line number Diff line number Diff line change
Expand Up @@ -305,13 +305,16 @@ library Ibc {
returns (address emittingContract, bytes[] memory topics, bytes memory unindexedData)
{
// The first byte is a RLP encoded receipt type so slice it off.
RLPReader.RLPItem[] memory receipt;
if (receiptRLP.length % 2 == 0) {
// If even, we don't clip bytes
receipt = RLPReader.readList(receiptRLP);
} else {
receipt = RLPReader.readList(Bytes.slice(receiptRLP, 1, receiptRLP.length - 1));
uint8 typeByte;
RnkSngh marked this conversation as resolved.
Show resolved Hide resolved
assembly {
typeByte := byte(0, mload(add(receiptRLP, 32)))
RnkSngh marked this conversation as resolved.
Show resolved Hide resolved
}
if (typeByte < 0x80) {
// Typed receipt: strip the type byte
receiptRLP = Bytes.slice(receiptRLP, 1, receiptRLP.length - 1);
dshiell marked this conversation as resolved.
Show resolved Hide resolved
}

RLPReader.RLPItem[] memory receipt = RLPReader.readList(receiptRLP);
/*
// RLP encoded receipt has the following structure. Logs are the 4th RLP list item.
type ReceiptRLP struct {
Expand All @@ -336,7 +339,7 @@ library Ibc {

RLPReader.RLPItem[] memory encodedTopics = RLPReader.readList(log[1]);
unindexedData = (RLPReader.readBytes(log[2])); // This is the raw unindexed data. in this case it's
// just an abi encoded uint64
// just an abi encoded uint64

topics = new bytes[](encodedTopics.length);
for (uint256 i = 0; i < encodedTopics.length; i++) {
Expand Down
Loading
Loading