vouch/services/submitter/service.go

49 lines
1.9 KiB
Go
Raw Normal View History

2020-09-27 23:46:00 -07:00
// Copyright © 2020 Attestant Limited.
// 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 submitter
import (
"context"
2020-10-28 08:09:51 -07:00
api "github.com/attestantio/go-eth2-client/api/v1"
2020-09-27 23:46:00 -07:00
spec "github.com/attestantio/go-eth2-client/spec/phase0"
)
// Service is the submitter service.
type Service interface{}
2020-11-26 12:32:04 -08:00
// AttestationsSubmitter is the interface for a submitter of attestations.
type AttestationsSubmitter interface {
// SubmitAttestations submits multiple attestations.
SubmitAttestations(ctx context.Context, attestations []*spec.Attestation) error
2020-09-27 23:46:00 -07:00
}
// BeaconBlockSubmitter is the interface for a submitter of beacon blocks.
type BeaconBlockSubmitter interface {
// SubmitBeaconBlock submits a block.
SubmitBeaconBlock(ctx context.Context, block *spec.SignedBeaconBlock) error
}
// BeaconCommitteeSubscriptionsSubmitter is the interface for a submitter of beacon committee subscriptions.
type BeaconCommitteeSubscriptionsSubmitter interface {
// SubmitBeaconCommitteeSubscription submits a batch of beacon committee subscriptions.
2020-10-28 08:09:51 -07:00
SubmitBeaconCommitteeSubscriptions(ctx context.Context, subscriptions []*api.BeaconCommitteeSubscription) error
2020-09-27 23:46:00 -07:00
}
// AggregateAttestationsSubmitter is the interface for a submitter of aggregate attestations.
type AggregateAttestationsSubmitter interface {
// SubmitAggregateAttestations submits aggregate attestations.
SubmitAggregateAttestations(ctx context.Context, aggregateAttestations []*spec.SignedAggregateAndProof) error
2020-09-27 23:46:00 -07:00
}