mirror of
https://github.com/planetmint/planetmint-go.git
synced 2025-03-30 15:08:28 +00:00
Make sure correct purpose and cointype are used (#60)
* Fix .gitignore Signed-off-by: Julian Strobl <jmastr@mailbox.org> * [test] Make sure correct Purpose and CoinType are used Signed-off-by: Julian Strobl <jmastr@mailbox.org> --------- Signed-off-by: Julian Strobl <jmastr@mailbox.org>
This commit is contained in:
parent
1a5d673a86
commit
459c0ae931
2
.gitignore
vendored
2
.gitignore
vendored
@ -6,4 +6,4 @@ release/
|
|||||||
.DS_Store
|
.DS_Store
|
||||||
vendor/
|
vendor/
|
||||||
tags
|
tags
|
||||||
planetmint-god
|
/planetmint-god
|
||||||
|
@ -6,7 +6,7 @@ import (
|
|||||||
"planetmint-go/app"
|
"planetmint-go/app"
|
||||||
)
|
)
|
||||||
|
|
||||||
func initSDKConfig() {
|
func initSDKConfig() *sdk.Config {
|
||||||
// Set prefixes
|
// Set prefixes
|
||||||
accountPubKeyPrefix := app.AccountAddressPrefix + "pub"
|
accountPubKeyPrefix := app.AccountAddressPrefix + "pub"
|
||||||
validatorAddressPrefix := app.AccountAddressPrefix + "valoper"
|
validatorAddressPrefix := app.AccountAddressPrefix + "valoper"
|
||||||
@ -22,4 +22,5 @@ func initSDKConfig() {
|
|||||||
// Set to PLMNT coin type as defined in SLIP44 (https://github.com/satoshilabs/slips/blob/master/slip-0044.md)
|
// Set to PLMNT coin type as defined in SLIP44 (https://github.com/satoshilabs/slips/blob/master/slip-0044.md)
|
||||||
config.SetCoinType(8680)
|
config.SetCoinType(8680)
|
||||||
config.Seal()
|
config.Seal()
|
||||||
|
return config
|
||||||
}
|
}
|
||||||
|
18
cmd/planetmint-god/cmd/config_test.go
Normal file
18
cmd/planetmint-god/cmd/config_test.go
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
package cmd
|
||||||
|
|
||||||
|
import (
|
||||||
|
"testing"
|
||||||
|
|
||||||
|
"github.com/stretchr/testify/assert"
|
||||||
|
)
|
||||||
|
|
||||||
|
// TestDerivationPath makes sure that purpose and cointype are set to PLMNT (see https://github.com/satoshilabs/slips/blob/master/slip-0044.md)
|
||||||
|
func TestDerivationPath(t *testing.T) {
|
||||||
|
sdkConfig := initSDKConfig()
|
||||||
|
|
||||||
|
purpose := uint32(44)
|
||||||
|
assert.Equal(t, purpose, sdkConfig.GetPurpose())
|
||||||
|
|
||||||
|
coinType := uint32(8680)
|
||||||
|
assert.Equal(t, coinType, sdkConfig.GetCoinType())
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user