wallet-interface
wallet-interface copied to clipboard
Exposed wallet-interface types should be interfaces types and not concrete types
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