diff --git a/modules/mesh-delivery-gate/cmd/mesh-delivery-gate/record_test.go b/modules/mesh-delivery-gate/cmd/mesh-delivery-gate/record_test.go index 9d72a2777..a5d091560 100644 --- a/modules/mesh-delivery-gate/cmd/mesh-delivery-gate/record_test.go +++ b/modules/mesh-delivery-gate/cmd/mesh-delivery-gate/record_test.go @@ -31,12 +31,12 @@ type ledgerFake struct { history []string failOn string // fill is what Fill answers; nil, the ledger says no fill. - fill *buscalls.LedgerFilled + fill *buscalls.Fill } -func (f *ledgerFake) Fill() (buscalls.LedgerFilled, error) { +func (f *ledgerFake) Fill() (buscalls.Fill, error) { if f.fill == nil { - return buscalls.LedgerFilled{}, errors.New("the runtime answers no mesh/ledger.fill") + return buscalls.Fill{}, errors.New("the runtime answers no mesh/ledger.fill") } return *f.fill, nil } @@ -809,8 +809,8 @@ func TestTheRecordsToolsReadThemAndEndOneByHand(t *testing.T) { // says room and hands the merge once the ledger is below 80 % again; the read tool says the fill. func TestTheRecordsLedgerSaysFillingFullAndRoom(t *testing.T) { const capBytes = 10 << 20 - filled := func(bytes uint64) *buscalls.LedgerFilled { - return &buscalls.LedgerFilled{History: buscalls.Fill{Count: 1, Bytes: bytes, MaxBytes: capBytes}, + filled := func(bytes uint64) *buscalls.Fill { + return &buscalls.Fill{History: buscalls.Fill{Count: 1, Bytes: bytes, MaxBytes: capBytes}, State: buscalls.Fill{Bytes: 1, MaxBytes: 64 << 20}} } heads := map[string]string{"novox/app@111111111111": strings.Repeat("1", 40)} diff --git a/modules/mesh-delivery-gate/cmd/mesh-delivery-gate/recordfill.go b/modules/mesh-delivery-gate/cmd/mesh-delivery-gate/recordfill.go index 33d856012..0154b4317 100644 --- a/modules/mesh-delivery-gate/cmd/mesh-delivery-gate/recordfill.go +++ b/modules/mesh-delivery-gate/cmd/mesh-delivery-gate/recordfill.go @@ -29,15 +29,15 @@ var ErrRecordsFull = errors.New("the delivery records' ledger is full") // fillReader is a ledger that says its fill against its cap. type fillReader interface { - Fill() (buscalls.LedgerFilled, error) + Fill() (buscalls.Fill, error) } -func (sdkLedger) Fill() (buscalls.LedgerFilled, error) { +func (sdkLedger) Fill() (buscalls.Fill, error) { out, err := ledgerCall(buscalls.LedgerFill, buscalls.LedgerRequest{Ledger: RecordsLedger}) if err != nil { - return buscalls.LedgerFilled{}, err + return buscalls.Fill{}, err } - var got buscalls.LedgerFilled + var got buscalls.Fill if err := json.Unmarshal(out, &got); err != nil { return got, fmt.Errorf("the ledger's fill is not readable: %w", err) }