Skip to content

Commit

Permalink
rename token.Store interface to token.BalanceStore (#16)
Browse files Browse the repository at this point in the history
  • Loading branch information
vitiko authored Jan 19, 2023
1 parent 106054e commit da6ea84
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions examples/erc20_utxo/service/allowance/allowance.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ var (
)

type Service struct {
balance token.Store
balance token.BalanceStore
account account.Getter
}

func NewService(account account.Getter, balance token.Store) *Service {
func NewService(account account.Getter, balance token.BalanceStore) *Service {
return &Service{
account: account,
balance: balance,
Expand Down
4 changes: 2 additions & 2 deletions extensions/token/balance.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@ import (
type BalanceService struct {
Account account.Getter
Token TokenGetter
Store Store
Store BalanceStore
}

func NewBalanceService(
accountResolver account.Getter,
tokenGetter TokenGetter,
store Store) *BalanceService {
store BalanceStore) *BalanceService {

return &BalanceService{
Account: accountResolver,
Expand Down
2 changes: 1 addition & 1 deletion extensions/token/balance_account.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"github.com/hyperledger-labs/cckit/state"
)

var _ Store = &AccountStore{}
var _ BalanceStore = &AccountStore{}

type AccountStore struct {
}
Expand Down
2 changes: 1 addition & 1 deletion extensions/token/balance_store.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ type (
TxId string
}

Store interface {
BalanceStore interface {
Get(router.Context, *BalanceId) (*Balance, error)
GetLocked(router.Context, *BalanceId) (*Balance, error)
List(router.Context, *TokenId) ([]*Balance, error)
Expand Down
2 changes: 1 addition & 1 deletion extensions/token/balance_utxo.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"github.com/hyperledger-labs/cckit/state"
)

var _ Store = &UTXOStore{}
var _ BalanceStore = &UTXOStore{}

var (
ErrSenderRecipientEqual = errors.New(`sender recipient equal`)
Expand Down

0 comments on commit da6ea84

Please sign in to comment.