Skip to content

Exposed wallet-interface types should be interfaces types and not concrete types #17

@placer14

Description

@placer14

Developers and implementors want to promote better abstractions and to motivate anything which consume wallet-interface to rely on their local implementations instead of on internal types. The exported types returned by interface functions mentioned in the wallet-interface package should be represented as interfaces as well. For example:

type TransactionRecord struct {
	Txid      string
	Index     uint32
	Value     int64
	Address   string
	Spent     bool
	Timestamp time.Time
}

should become

type TransactionRecord interface {
	Txid()      string
	Index()     uint32
	Value()     int64
	Address()   string
	Spent()     bool
	Timestamp() time.Time
}

Exported Types to migrate:

  • Txn
  • Utxo
  • Stxo
  • Txns
  • Keys
  • FeeLevel
  • TransactionInput
  • TransactionOutput
  • Signature
  • TransactionCallback
  • TransactionRecord

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions