pool/interfaces.go
positiveblue 1589efe1ea
rpcserver: add Marshaler interface
The Marshaler interface is used to transform internal types to
decorated RPC ones.

It decouples that functionality form the rpcServer so it is easier to
test exhaustively.
2021-12-14 20:40:02 -08:00

16 lines
482 B
Go

package pool
import (
"context"
"github.com/lightninglabs/pool/account"
"github.com/lightninglabs/pool/poolrpc"
)
// Marshaler interface to transform internal types to decorated RPC ones.
type Marshaler interface {
// MarshallAccountsWithAvailableBalance returns the RPC representation
// of an account with the account.AvailableBalance value populated.
MarshallAccountsWithAvailableBalance(ctx context.Context,
accounts []*account.Account) ([]*poolrpc.Account, error)
}