Skip to content

Commit

Permalink
rename some interfaces
Browse files Browse the repository at this point in the history
  • Loading branch information
JeremyPansier committed Mar 15, 2024
1 parent 8e9023e commit 3f4cae5
Show file tree
Hide file tree
Showing 32 changed files with 338 additions and 338 deletions.
6 changes: 3 additions & 3 deletions domain/blockchain.go → domain/blocks_manager.go
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
package domain

type Blockchain interface {
type BlocksManager interface {
AddBlock(timestamp int64, transactionsBytes []byte, newRegisteredAddresses []string) error
Blocks(startingBlockHeight uint64) []byte
Copy() Blockchain // TODO remove
Copy() BlocksManager // TODO remove
FirstBlockTimestamp() int64
LastBlockTimestamp() int64
Utxos(address string) []byte
Utxo(input InputInfo) (Utxo, error)
Utxo(input InputInfoProvider) (UtxoInfoProvider, error)
}
112 changes: 56 additions & 56 deletions domain/blockchain_mock.go → domain/blocks_manager_mock.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion domain/input_info.go → domain/input_info_provider.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package domain

type InputInfo interface {
type InputInfoProvider interface {
TransactionId() string
OutputIndex() uint16
}
File renamed without changes.
2 changes: 1 addition & 1 deletion domain/ledger/transaction.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ func (transaction *Transaction) VerifySignatures(utxoFinder domain.UtxoFinder) e
return nil
}

func (transaction *Transaction) Fee(settings validatornode.Settings, timestamp int64, utxoFinder domain.UtxoFinder) (uint64, error) {
func (transaction *Transaction) Fee(settings validatornode.SettingsProvider, timestamp int64, utxoFinder domain.UtxoFinder) (uint64, error) {
var inputsValue uint64
var outputsValue uint64
for _, input := range transaction.inputs {
Expand Down
File renamed without changes.
8 changes: 4 additions & 4 deletions domain/network/p2p/gp2p/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,18 @@ import (
const BadRequest = "bad request"

type Handler struct {
blockchain domain.Blockchain
blockchain domain.BlocksManager
settings []byte
synchronizer network.Synchronizer
transactionsPool domain.TransactionsPool
transactionsPool domain.TransactionsManager
watch clock.Watch
logger log.Logger
}

func NewHandler(blockchain domain.Blockchain,
func NewHandler(blockchain domain.BlocksManager,
settings []byte,
synchronizer network.Synchronizer,
transactionsPool domain.TransactionsPool,
transactionsPool domain.TransactionsManager,
watch clock.Watch,
logger log.Logger) *Handler {
return &Handler{blockchain, settings, synchronizer, transactionsPool, watch, logger}
Expand Down
Loading

0 comments on commit 3f4cae5

Please sign in to comment.