@@ -99,21 +99,21 @@ contract NotificationReceiver {
99
99
*/
100
100
function processSectorContentChanged (bytes memory params ) internal returns (bytes memory ) {
101
101
102
- /* We begin by parsing a single tuple: (sectors)
103
- */
104
- (uint checkTupleLen , uint byteIdx ) = readFixedArray (params, 0 );
105
- require (checkTupleLen == 1 , "Invalid params outer tuple " );
102
+ uint checkTupleLen;
103
+ uint byteIdx = 0 ;
106
104
105
+ // We don't need to parse the SectorContentChangedParams as a tuple because
106
+ // the type is encoded as serde transparent. So just parse the sectors array directly
107
107
uint nSectors;
108
- (nSectors, byteIdx) = readFixedArray (params, 0 );
108
+ (nSectors, byteIdx) = readFixedArray (params, byteIdx );
109
109
require (nSectors > 0 , "Invalid non positive sectors field " );
110
110
111
111
CBORBuffer memory ret_acc;
112
112
{
113
113
// Setup return value ret_acc
114
114
// ret_acc accumulates return cbor array
115
115
ret_acc = createCBOR (64 );
116
- startFixedArray (ret_acc, 1 ); // SectorContentChangedReturn
116
+ // No SectorContentChangedReturn outer tuple as it is serde transparent
117
117
startFixedArray (ret_acc, uint64 (nSectors)); // sectors: Vec<SectorReturn>
118
118
}
119
119
for (uint i = 0 ; i < nSectors; i++ ) {
@@ -134,7 +134,7 @@ contract NotificationReceiver {
134
134
(pieceCnt, byteIdx) = readFixedArray (params, byteIdx);
135
135
136
136
{
137
- startFixedArray (ret_acc, 1 ); // SectorReturn
137
+ // No SectorReturn outer tuple as it is serde transparent
138
138
startFixedArray (ret_acc, uint64 (pieceCnt)); // added: Vec<PieceReturn>
139
139
}
140
140
@@ -167,7 +167,7 @@ contract NotificationReceiver {
167
167
sectorNotificationIndices[sector].push (notificationIndex);
168
168
totalNotifications++ ;
169
169
{
170
- startFixedArray (ret_acc, 1 ); // PieceReturn
170
+ // No PieceReturn outer tuple as it is serde transparent
171
171
writeBool (ret_acc, true ); // accepted (set all to true)
172
172
}
173
173
}
0 commit comments