From da6ea84a57ad8d5124d4ff049bd763f83e34192a Mon Sep 17 00:00:00 2001 From: Victor Nosov Date: Thu, 19 Jan 2023 18:25:23 +0300 Subject: [PATCH] rename token.Store interface to token.BalanceStore (#16) --- examples/erc20_utxo/service/allowance/allowance.go | 4 ++-- extensions/token/balance.go | 4 ++-- extensions/token/balance_account.go | 2 +- extensions/token/balance_store.go | 2 +- extensions/token/balance_utxo.go | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/examples/erc20_utxo/service/allowance/allowance.go b/examples/erc20_utxo/service/allowance/allowance.go index ca62b6b..af50990 100644 --- a/examples/erc20_utxo/service/allowance/allowance.go +++ b/examples/erc20_utxo/service/allowance/allowance.go @@ -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, diff --git a/extensions/token/balance.go b/extensions/token/balance.go index 0c99bac..700ab62 100644 --- a/extensions/token/balance.go +++ b/extensions/token/balance.go @@ -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, diff --git a/extensions/token/balance_account.go b/extensions/token/balance_account.go index 7e66a30..d087daf 100644 --- a/extensions/token/balance_account.go +++ b/extensions/token/balance_account.go @@ -9,7 +9,7 @@ import ( "github.com/hyperledger-labs/cckit/state" ) -var _ Store = &AccountStore{} +var _ BalanceStore = &AccountStore{} type AccountStore struct { } diff --git a/extensions/token/balance_store.go b/extensions/token/balance_store.go index 91ddc07..28fffd4 100644 --- a/extensions/token/balance_store.go +++ b/extensions/token/balance_store.go @@ -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) diff --git a/extensions/token/balance_utxo.go b/extensions/token/balance_utxo.go index 748eeef..748fc84 100644 --- a/extensions/token/balance_utxo.go +++ b/extensions/token/balance_utxo.go @@ -9,7 +9,7 @@ import ( "github.com/hyperledger-labs/cckit/state" ) -var _ Store = &UTXOStore{} +var _ BalanceStore = &UTXOStore{} var ( ErrSenderRecipientEqual = errors.New(`sender recipient equal`)