Skip to content

Commit

Permalink
refactor: rm comment and update interface input
Browse files Browse the repository at this point in the history
  • Loading branch information
hopeyen committed Oct 31, 2024
1 parent 6398eac commit 076dd01
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
6 changes: 4 additions & 2 deletions api/clients/accountant.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,12 @@ import (
var minNumBins uint32 = 3
var requiredQuorums = []uint8{0, 1}

type IAccountant interface {
AccountBlob(ctx context.Context, data []byte, quorums []uint8) (uint32, uint64, error)
type Accountant interface {
AccountBlob(ctx context.Context, numSymbols uint64, quorums []uint8) (*commonpb.PaymentHeader, []byte, error)
}

var _ Accountant = &accountant{}

type accountant struct {
// on-chain states
reservation *core.ActiveReservation
Expand Down
4 changes: 2 additions & 2 deletions api/clients/disperser_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ type disperserClient struct {
// or to use a pool of connections here.
conn *grpc.ClientConn
client disperser_rpc.DisperserClient
accountant *accountant
accountant Accountant
}

var _ DisperserClient = &disperserClient{}
Expand All @@ -91,7 +91,7 @@ var _ DisperserClient = &disperserClient{}
//
// // Subsequent calls will use the existing connection
// status2, requestId2, err := client.DisperseBlob(ctx, otherData, otherQuorums)
func NewDisperserClient(config *Config, signer core.BlobRequestSigner, accountant *accountant) DisperserClient {
func NewDisperserClient(config *Config, signer core.BlobRequestSigner, accountant Accountant) DisperserClient {
return &disperserClient{
config: config,
signer: signer,
Expand Down
1 change: 0 additions & 1 deletion core/auth/payment_signer.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ func NewPaymentSigner(privateKeyHex string) *PaymentSigner {
}

// SignBlobPayment signs the payment header and returns the signature
// func (s *PaymentSigner) SignBlobPayment(header *commonpb.PaymentHeader) ([]byte, error) {
func (s *PaymentSigner) SignBlobPayment(pm *core.PaymentMetadata) ([]byte, error) {
// header.AccountId = s.GetAccountID()
// pm := core.ConvertPaymentHeader(header)
Expand Down

0 comments on commit 076dd01

Please sign in to comment.