Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
11 tasks
placer14 opened this issue May 22, 2019 · 0 comments
Open
11 tasks
Assignees

Comments

@placer14
Copy link
Member

placer14 commented May 22, 2019

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
@placer14 placer14 self-assigned this May 22, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant