@@ -2580,13 +2580,13 @@ func TestMaxSectorBatchSize(t *testing.T) {
25802580
25812581 // append duplicate roots so the contract has over 1 TiB of sectors
25822582 var appendRoots []types.Hash256
2583- for i := range 2 * proto4 .MaxSectorBatchSize {
2583+ for i := range proto4 .MaxSectorBatchSize + 1 {
25842584 appendRoots = append (appendRoots , roots [i % len (roots )])
25852585 }
25862586
25872587 _ , err = rhp4 .RPCAppendSectors (context .Background (), transport , renterKey , cs , settings .Prices , revision , appendRoots )
2588- if code := proto4 .ErrorCode (err ); code != proto4 .ErrorCodeDecoding {
2589- t .Fatalf ("expected decoding error, got %d" , code )
2588+ if code := proto4 .ErrorCode (err ); code != proto4 .ErrorCodeBadRequest {
2589+ t .Fatalf ("expected BadRequest error, got %d" , code )
25902590 }
25912591
25922592 // append all the sector roots to the contract
@@ -2608,13 +2608,13 @@ func TestMaxSectorBatchSize(t *testing.T) {
26082608 revision .Revision = rootsResp .Revision
26092609
26102610 // try to remove too many indices. They must be unique.
2611- indices := make ([]uint64 , len (appendRoots )* 10 )
2611+ indices := make ([]uint64 , len (appendRoots )+ 1 )
26122612 for i := range indices {
26132613 indices [i ] = uint64 (i )
26142614 }
26152615 _ , err = rhp4 .RPCFreeSectors (context .Background (), transport , renterKey , cs , settings .Prices , revision , indices )
2616- if code := proto4 .ErrorCode (err ); code != proto4 .ErrorCodeDecoding {
2617- t .Fatalf ("expected decoding error, got %q" , err )
2616+ if code := proto4 .ErrorCode (err ); code != proto4 .ErrorCodeBadRequest {
2617+ t .Fatalf ("expected BadRequest error, got %q" , err )
26182618 }
26192619
26202620 indices = indices [:len (appendRoots )]
0 commit comments