feat: import ethermint without forking (#378)

* cmd: cleanup

* update gh action

* lint

* more cleanup

* update config

* register denom
This commit is contained in:
Federico Kunze Küllmer
2021-07-28 05:47:29 -04:00
committed by GitHub
parent bc2a2eb8f3
commit 09746c6a51
21 changed files with 166 additions and 138 deletions
+32
View File
@@ -0,0 +1,32 @@
package types
import (
ethaccounts "github.com/ethereum/go-ethereum/accounts"
)
var (
// Bip44CoinType satisfies EIP84. See https://github.com/ethereum/EIPs/issues/84 for more info.
Bip44CoinType uint32 = 60
// BIP44HDPath is the default BIP44 HD path used on Ethereum.
BIP44HDPath = ethaccounts.DefaultBaseDerivationPath.String()
)
type (
HDPathIterator func() ethaccounts.DerivationPath
)
// HDPathIterator receives a base path as a string and a boolean for the desired iterator type and
// returns a function that iterates over the base HD path, returning the string.
func NewHDPathIterator(basePath string, ledgerIter bool) (HDPathIterator, error) {
hdPath, err := ethaccounts.ParseDerivationPath(basePath)
if err != nil {
return nil, err
}
if ledgerIter {
return ethaccounts.LedgerLiveIterator(hdPath), nil
}
return ethaccounts.DefaultIterator(hdPath), nil
}