Skip to content

Commit

Permalink
feat: allow txList with zero byte
Browse files Browse the repository at this point in the history
  • Loading branch information
davidtaikocha committed Dec 9, 2022
1 parent 37992fd commit f6f95f7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion packages/protocol/contracts/L1/v1/V1Proposing.sol
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ library V1Proposing {
bytes calldata txList = inputs[1];
// perform validation and populate some fields
require(
txList.length > 0 &&
txList.length >= 0 &&
txList.length <= LibConstants.K_TXLIST_MAX_BYTES &&
meta.txListHash == txList.hashTxList(),
"L1:txList"
Expand Down
3 changes: 3 additions & 0 deletions packages/protocol/contracts/libs/LibTxDecoder.sol
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,9 @@ library LibTxDecoder {
function decodeTxList(
bytes calldata encoded
) public pure returns (TxList memory txList) {
if (encoded.length == 0) {
return txList;
}
LibRLPReader.RLPItem[] memory txs = LibRLPReader.readList(encoded);

Tx[] memory _txList = new Tx[](txs.length);
Expand Down

0 comments on commit f6f95f7

Please sign in to comment.