Skip to content

Commit 370b012

Browse files
committed
feat: add SetDERConversion to reset skipDERConversion
add Ledger app name
1 parent 0382723 commit 370b012

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

crypto/ledger/ledger_secp256k1.go

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@ import (
1717
// options stores the Ledger Options that can be used to customize Ledger usage
1818
var options Options
1919

20+
// AppName defines the Ledger app used for signing. Cosmos SDK uses the Cosmos app
21+
const AppName = "Cosmos"
22+
2023
type (
2124
// discoverLedgerFn defines a Ledger discovery function that returns a
2225
// connected device or an error upon failure. Its allows a method to avoid CGO
@@ -66,7 +69,7 @@ func initOptionsDefault() {
6669
options.createPubkey = func(key []byte) types.PubKey {
6770
return &secp256k1.PubKey{Key: key}
6871
}
69-
options.appName = "Cosmos"
72+
options.appName = AppName
7073
options.skipDERConversion = false
7174
}
7275

@@ -90,6 +93,11 @@ func SetSkipDERConversion() {
9093
options.skipDERConversion = true
9194
}
9295

96+
// Set the skip DER Conversion requirement to default false
97+
func SetDERConversion() {
98+
options.skipDERConversion = false
99+
}
100+
93101
// NewPrivKeySecp256k1Unsafe will generate a new key and store the public key for later use.
94102
//
95103
// This function is marked as unsafe as it will retrieve a pubkey without user verification.

0 commit comments

Comments
 (0)