DiviProject/atomic-swaps

[RC@1.1.0] Customizable key parsing

ChrisCates opened this issue · 0 comments

Currently, the project relies on divid and diviutil to parse public and private keys. What I would like to see in the next release is a way to parse keys without having to have the entire chain parameters saved.

If you look at address.go in diviutil: https://github.com/DiviProject/diviutil/blob/master/address.go

There is a way to decode addresses.
This decoding is dependent on params.go in divid/chaincfg.

I would like to modify it so that you can just specify the type of encoding the key is. So that you can decode the address.

This would mean that:

func DecodeAddress(addr string, defaultNet *chaincfg.Params) (Address, error) {

}

Would be simplified into something like this:

func DecodeAddress(addr string, addressConfig addrConfig) (Address, error) {

}