Files
substrate/cmd/ateapi/internal/debugapi/service.go
T
Tim Hockin e2f2b1ebe9 Use more specific interfaces than store.Interface (#986)
This makes it clear(er) which methods of store.Interface are used in
which paths.

No functional changes

@juli4n @laoj2 as a first step towards splitting the validation logic
out of the RPC layer and out of the storage layer. This at least gives
us targets for what to pay attention to first.
2026-08-16 19:03:03 -04:00

43 lines
1.2 KiB
Go

// Copyright 2026 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package debugapi
import (
"context"
"github.com/agent-substrate/substrate/pkg/proto/ateapipb"
)
// Service implements ateapipb.DebugServer.
type Service struct {
ateapipb.UnimplementedDebugServer
persistence debuggingStore
}
var _ ateapipb.DebugServer = (*Service)(nil)
// NewService creates a new debug service.
func NewService(persistence debuggingStore) *Service {
return &Service{
persistence: persistence,
}
}
// debuggingStore enumerates the exact storage methods needed by
// the debug API and nothing more.
type debuggingStore interface {
DebugClearAll(ctx context.Context) error
}