diff --git a/src/FilecoinPayV1.sol b/src/FilecoinPayV1.sol index 0d1dc78..201935a 100644 --- a/src/FilecoinPayV1.sol +++ b/src/FilecoinPayV1.sol @@ -1361,7 +1361,15 @@ contract FilecoinPayV1 is ReentrancyGuard { // Add the gross settled amount to our running total totalGrossSettled += segmentGrossSettled; - note = validationNote; + + // Accumulate validation notes from each segment + if (bytes(validationNote).length > 0) { + if (bytes(note).length > 0) { + note = string.concat(note, "; ", validationNote); + } else { + note = validationNote; + } + } // If validator partially settled the segment, exit early if (rail.settledUpTo < segmentEndBoundary) { diff --git a/test/RailSettlement.t.sol b/test/RailSettlement.t.sol index d2acf29..a7e0e36 100644 --- a/test/RailSettlement.t.sol +++ b/test/RailSettlement.t.sol @@ -226,8 +226,13 @@ contract RailSettlementTest is Test, BaseTestHelper { RailSettlementHelpers.SettlementResult memory result = settlementHelper.settleRailAndVerify(railId, block.number, expectedAmount, block.number); - // Verify validator note - assertEq(result.note, "Standard approved payment", "Validator note should match"); + // Verify validator notes are accumulated from all 9 segments + // (8 rate changes in the queue + 1 final segment) + string memory expectedNote = "Standard approved payment"; + for (uint256 i = 1; i < 9; i++) { + expectedNote = string.concat(expectedNote, "; Standard approved payment"); + } + assertEq(result.note, expectedNote, "Validator notes should be accumulated"); } function testValidationWithReducedAmount() public {