Skip to content

Commit bd59f45

Browse files
authored
Merge pull request #6 from ZondaX/upgrade1.5
Upgrade support to Cosmos app v1.5
2 parents e4c9d22 + ee19482 commit bd59f45

File tree

5 files changed

+72
-98
lines changed

5 files changed

+72
-98
lines changed

go.mod

-8
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,7 @@ require (
66
github.com/btcsuite/btcd v0.0.0-20190115013929-ed77733ec07d
77
github.com/cosmos/ledger-go v0.9.1
88
github.com/davecgh/go-spew v1.1.1 // indirect
9-
github.com/fortytw2/leaktest v1.3.0 // indirect
10-
github.com/go-kit/kit v0.6.0 // indirect
11-
github.com/go-logfmt/logfmt v0.4.0 // indirect
12-
github.com/go-stack/stack v1.8.0 // indirect
13-
github.com/gogo/protobuf v1.1.1 // indirect
149
github.com/pkg/errors v0.8.1 // indirect
1510
github.com/stretchr/testify v1.3.0
16-
github.com/tendermint/tendermint v0.29.1
1711
github.com/zondax/hid v0.9.0 // indirect
18-
golang.org/x/crypto v0.0.0-20181203042331-505ab145d0a9 // indirect
19-
golang.org/x/sys v0.0.0-20190129075346-302c3dd5f1cc // indirect
2012
)

go.sum

-18
Original file line numberDiff line numberDiff line change
@@ -14,25 +14,13 @@ github.com/davecgh/go-spew v0.0.0-20171005155431-ecdeabc65495/go.mod h1:J7Y8YcW2
1414
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
1515
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
1616
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
17-
github.com/fortytw2/leaktest v1.3.0 h1:u8491cBMTQ8ft8aeV+adlcytMZylmA5nnwwkRZjI8vw=
18-
github.com/fortytw2/leaktest v1.3.0/go.mod h1:jDsjWgpAGjm2CA7WthBh/CdZYEPF31XHquHwclZch5g=
1917
github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo=
20-
github.com/go-kit/kit v0.6.0 h1:wTifptAGIyIuir4bRyN4h7+kAa2a4eepLYVmRe5qqQ8=
21-
github.com/go-kit/kit v0.6.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as=
22-
github.com/go-logfmt/logfmt v0.4.0 h1:MP4Eh7ZCb31lleYCFuwm0oe4/YGak+5l1vA2NOE80nA=
23-
github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk=
24-
github.com/go-stack/stack v1.8.0 h1:5SgMzNM5HxrEjV0ww2lTmX6E2Izsfxas4+YHWRs3Lsk=
25-
github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY=
26-
github.com/gogo/protobuf v1.1.1 h1:72R+M5VuhED/KujmZVcIquuo8mBgX4oVda//DQb3PXo=
27-
github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ=
2818
github.com/golang/protobuf v1.2.0 h1:P3YflyNX/ehuJFLhxviNdFxQPkGK5cDcApsge1SqnvM=
2919
github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
3020
github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU=
3121
github.com/jessevdk/go-flags v0.0.0-20141203071132-1679536dcc89/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI=
3222
github.com/jrick/logrotate v1.0.0/go.mod h1:LNinyqDIJnpAur+b8yyulnQw/wDuN1+BYKlTRt3OuAQ=
3323
github.com/kkdai/bstream v0.0.0-20161212061736-f391b8402d23/go.mod h1:J+Gs4SYgM6CZQHDETBtE9HaSEkGmuNXF86RwHhHUvq4=
34-
github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515 h1:T+h1c/A9Gawja4Y9mFVWj2vyii2bbUNDw3kt9VxK2EY=
35-
github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc=
3624
github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
3725
github.com/onsi/ginkgo v1.7.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
3826
github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY=
@@ -43,20 +31,14 @@ github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZN
4331
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
4432
github.com/stretchr/testify v1.3.0 h1:TivCn/peBQ7UY8ooIcPgZFpTNSz0Q2U6UrFlUfqbe0Q=
4533
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
46-
github.com/tendermint/tendermint v0.29.1 h1:9QwXNxtxgfekONjEBvnZp2g3mQH/fS5QiUyEXo7QOGs=
47-
github.com/tendermint/tendermint v0.29.1/go.mod h1:ymcPyWblXCplCPQjbOYbrF1fWnpslATMVqiGgWbZrlc=
4834
github.com/zondax/hid v0.9.0 h1:eiT3P6vNxAEVxXMw66eZUAAnU2zD33JBkfG/EnfAKl8=
4935
github.com/zondax/hid v0.9.0/go.mod h1:l5wttcP0jwtdLjqjMMWFVEE7d1zO0jvSPA9OPZxWpEM=
5036
golang.org/x/crypto v0.0.0-20170930174604-9419663f5a44/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
51-
golang.org/x/crypto v0.0.0-20181203042331-505ab145d0a9 h1:mKdxBk7AujPs8kU4m80U72y/zjbZ3UcXC7dClwKbUI0=
52-
golang.org/x/crypto v0.0.0-20181203042331-505ab145d0a9/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
5337
golang.org/x/net v0.0.0-20180906233101-161cd47e91fd h1:nTDtHvHSdCn1m6ITfMRqtOd/9+7a3s8RBNOZ3eYZzJA=
5438
golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
5539
golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f h1:wMNYb4v58l5UBM7MYRLPG6ZhfOqbKu7X5eyFl8ZhKvA=
5640
golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
5741
golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
58-
golang.org/x/sys v0.0.0-20190129075346-302c3dd5f1cc h1:WiYx1rIFmx8c0mXAFtv5D/mHyKe1+jmuP7PViuwqwuQ=
59-
golang.org/x/sys v0.0.0-20190129075346-302c3dd5f1cc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
6042
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
6143
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
6244
gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys=

user_app.go

+11-40
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ import (
2020
"fmt"
2121
"math"
2222

23+
"github.com/btcsuite/btcd/btcec"
2324
"github.com/cosmos/ledger-go"
2425
)
2526

@@ -108,11 +109,13 @@ func (ledger *LedgerCosmos) GetVersion() (*VersionInfo, error) {
108109
}
109110

110111
// SignSECP256K1 signs a transaction using Cosmos user app
112+
// this command requires user confirmation in the device
111113
func (ledger *LedgerCosmos) SignSECP256K1(bip32Path []uint32, transaction []byte) ([]byte, error) {
112114
return ledger.sign(userINSSignSECP256K1, bip32Path, transaction)
113115
}
114116

115-
// GetPublicKeySECP256K1 retrieves the public key for the corresponding bip32 derivation path
117+
// GetPublicKeySECP256K1 retrieves the public key for the corresponding bip32 derivation path (compressed)
118+
// this command DOES NOT require user confirmation in the device
116119
func (ledger *LedgerCosmos) GetPublicKeySECP256K1(bip32Path []uint32) ([]byte, error) {
117120
pathBytes, err := GetBip32bytes(bip32Path, 3)
118121
if err != nil {
@@ -131,52 +134,20 @@ func (ledger *LedgerCosmos) GetPublicKeySECP256K1(bip32Path []uint32) ([]byte, e
131134
return nil, fmt.Errorf("invalid response")
132135
}
133136

134-
return response, nil
137+
cmp, err := btcec.ParsePubKey(response[:], btcec.S256())
138+
if err != nil {
139+
return nil, err
140+
}
141+
return cmp.SerializeCompressed(), nil
135142
}
136143

137144
func validHRPByte(b byte) bool {
138145
// https://github.com/bitcoin/bips/blob/master/bip-0173.mediawiki
139146
return b >= 33 && b <= 126
140147
}
141148

142-
// ShowAddressSECP256K1 shows the address for the corresponding bip32 derivation path
143-
func (ledger *LedgerCosmos) ShowAddressSECP256K1(bip32Path []uint32, hrp string) error {
144-
if len(hrp) > 83 {
145-
return fmt.Errorf("hrp len should be <10")
146-
}
147-
148-
hrpBytes := []byte(hrp)
149-
for _, b := range hrpBytes {
150-
if !validHRPByte(b) {
151-
return fmt.Errorf("all characters in the HRP must be in the [33, 126] range")
152-
}
153-
}
154-
155-
// Check that app is at least 1.1.0
156-
requiredVersion := VersionInfo{0, 1, 1, 0,}
157-
err := CheckVersion(ledger.version, requiredVersion)
158-
if err !=nil {
159-
return err
160-
}
161-
162-
pathBytes, err := GetBip32bytes(bip32Path, 3)
163-
if err != nil {
164-
return err
165-
}
166-
167-
// Prepare message
168-
header := []byte{userCLA, userINSPublicKeySECP256K1ShowBech32, 0, 0, 0}
169-
message := append(header, byte(len(hrpBytes)))
170-
message = append(message, hrpBytes...)
171-
message = append(message, pathBytes...)
172-
message[4] = byte(len(message) - len(header)) // update length
173-
174-
_, err = ledger.api.Exchange(message)
175-
176-
return err
177-
}
178-
179-
// ShowAddressSECP256K1 shows the address for the corresponding bip32 derivation path
149+
// GetAddressPubKeySECP256K1 returns the pubkey (compressed) and address (bech(
150+
// this command requires user confirmation in the device
180151
func (ledger *LedgerCosmos) GetAddressPubKeySECP256K1(bip32Path []uint32, hrp string) (pubkey []byte, addr string, err error) {
181152
// Check that app is at least 1.3.1
182153
requiredVersion := VersionInfo{0, 1, 3, 1,}

user_app_test.go

+59-30
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,12 @@
1717
package ledger_cosmos_go
1818

1919
import (
20+
"crypto/sha256"
2021
"encoding/hex"
2122
"fmt"
22-
secp256k1 "github.com/btcsuite/btcd/btcec"
23+
"github.com/btcsuite/btcd/btcec"
2324
"github.com/stretchr/testify/assert"
2425
"github.com/stretchr/testify/require"
25-
"github.com/tendermint/tendermint/crypto"
2626
"strings"
2727
"testing"
2828
)
@@ -54,7 +54,7 @@ func Test_UserGetVersion(t *testing.T) {
5454

5555
assert.Equal(t, uint8(0x0), version.AppMode, "TESTING MODE ENABLED!!")
5656
assert.Equal(t, uint8(0x1), version.Major, "Wrong Major version")
57-
assert.Equal(t, uint8(0x1), version.Minor, "Wrong Minor version")
57+
assert.Equal(t, uint8(0x5), version.Minor, "Wrong Minor version")
5858
assert.Equal(t, uint8(0x0), version.Patch, "Wrong Patch version")
5959
}
6060

@@ -67,26 +67,20 @@ func Test_UserGetPublicKey(t *testing.T) {
6767

6868
userApp.api.Logging = true
6969

70-
path := []uint32{44, 118, 0, 0, 0}
70+
path := []uint32{44, 118, 5, 0, 21}
7171

7272
pubKey, err := userApp.GetPublicKeySECP256K1(path)
7373
if err != nil {
7474
t.Fatalf("Detected error, err: %s\n", err.Error())
7575
}
7676

77-
assert.Equal(
78-
t,
79-
65,
80-
len(pubKey),
81-
"Public key has wrong length: %x, expected length: %x\n", pubKey, 65)
82-
77+
assert.Equal(t, 33, len(pubKey), "Public key has wrong length: %x, expected length: %x\n", pubKey, 65)
8378
fmt.Printf("PUBLIC KEY: %x\n", pubKey)
8479

85-
_, err = secp256k1.ParsePubKey(pubKey[:], secp256k1.S256())
86-
require.Nil(t, err, "Error parsing public key err: %s\n", err)
80+
assert.Equal(t, "03cb5a33c61595206294140c45efa8a817533e31aa05ea18343033a0732a677005", hex.EncodeToString(pubKey), "Unexpected pubkey")
8781
}
8882

89-
func Test_UserShowAddresses(t *testing.T) {
83+
func Test_GetAddressPubKeySECP256K1_Zero(t *testing.T) {
9084
userApp, err := FindLedgerCosmosUserApp()
9185
if err != nil {
9286
t.Fatalf(err.Error())
@@ -98,10 +92,44 @@ func Test_UserShowAddresses(t *testing.T) {
9892
hrp := "cosmos"
9993
path := []uint32{44, 118, 0, 0, 0}
10094

101-
err = userApp.ShowAddressSECP256K1(path, hrp)
95+
pubKey, addr, err := userApp.GetAddressPubKeySECP256K1(path, hrp)
10296
if err != nil {
10397
t.Fatalf("Detected error, err: %s\n", err.Error())
10498
}
99+
100+
fmt.Printf("PUBLIC KEY : %x\n", pubKey)
101+
fmt.Printf("BECH32 ADDR: %s\n", addr)
102+
103+
assert.Equal(t, 33, len(pubKey), "Public key has wrong length: %x, expected length: %x\n", pubKey, 65)
104+
105+
assert.Equal(t, "034fef9cd7c4c63588d3b03feb5281b9d232cba34d6f3d71aee59211ffbfe1fe87", hex.EncodeToString(pubKey), "Unexpected pubkey")
106+
assert.Equal(t, "cosmos1w34k53py5v5xyluazqpq65agyajavep2rflq6h", addr, "Unexpected addr")
107+
}
108+
109+
func Test_GetAddressPubKeySECP256K1(t *testing.T) {
110+
userApp, err := FindLedgerCosmosUserApp()
111+
if err != nil {
112+
t.Fatalf(err.Error())
113+
}
114+
defer userApp.Close()
115+
116+
userApp.api.Logging = true
117+
118+
hrp := "cosmos"
119+
path := []uint32{44, 118, 5, 0, 21}
120+
121+
pubKey, addr, err := userApp.GetAddressPubKeySECP256K1(path, hrp)
122+
if err != nil {
123+
t.Fatalf("Detected error, err: %s\n", err.Error())
124+
}
125+
126+
fmt.Printf("PUBLIC KEY : %x\n", pubKey)
127+
fmt.Printf("BECH32 ADDR: %s\n", addr)
128+
129+
assert.Equal(t, 33, len(pubKey), "Public key has wrong length: %x, expected length: %x\n", pubKey, 65)
130+
131+
assert.Equal(t, "03cb5a33c61595206294140c45efa8a817533e31aa05ea18343033a0732a677005", hex.EncodeToString(pubKey), "Unexpected pubkey")
132+
assert.Equal(t, "cosmos162zm3k8mc685592d7vej2lxrp58mgmkcec76d6", addr, "Unexpected addr")
105133
}
106134

107135
func Test_UserPK_HDPaths(t *testing.T) {
@@ -116,16 +144,16 @@ func Test_UserPK_HDPaths(t *testing.T) {
116144
path := []uint32{44, 118, 0, 0, 0}
117145

118146
expected := []string{
119-
"044fef9cd7c4c63588d3b03feb5281b9d232cba34d6f3d71aee59211ffbfe1fe877bff8521bf5243e80be922e51cee0faa8346b113fdec822c4d902e42b22bc345",
120-
"0460d0487a3dfce9228eee2d0d83a40f6131f551526c8e52066fe7fe1e4a509666d60da24e97777510db9b238870e184891b580610ec6dafaf12c7abffed3670c6",
121-
"04a2670393d02b162d0ed06a08041e80d86be36c0564335254df7462447eb69ab3f5a54ab07a8622ab23c28e9240ce58f4015ec401d95b08221b74e2a4a209ba6d",
122-
"043222fc61795077791665544a90740e8ead638a391a3b8f9261f4a226b396c042a118bb64eccd89941d73de7cb12beed5a47de61049c7fc0d4708a4a0f5637957",
123-
"04f577473348d7b01e7af2f245e36b98d181bc935ec8b552cde5932b646dc7be0415b9fd94af37dc295e25e35d3840fdd3cb1d0baa411bdc00d15dca427abdff3f",
124-
"0422b1a5486be0a2d5f3c5866be46e05d1bde8cda5ea1c4c77a9bc48d2fa2753bcbb49b6c9d4be25bed7fb75c2e0c43c25175e88893c4f7963398a5aac3230c79e",
125-
"0477a1c826d3a03ca4ee94fc4dea6bccb2bac5f2ac0419a128c29f8e88f1ff295ac6a16c770d38ee0e55bec83e8d8e3f1b1616ce77055a928255919340053a477d",
126-
"041b75c84453935ab76f8c8d0b6566c3fcc101cc5c59d7000bfc9101961e9308d9228b0af378c4e6a38eeaf18175d2b2a7ab3fad9c9a4b117775f2e4a4ac633aff",
127-
"048905a42433b1d677cc8afd36861430b9a8529171b0616f733659f131c3f80221e222d162dbcde7c77be3d82b4f666c2acc1e25aaeb3e4fadfb8c7c6b1282374b",
128-
"048be7f348902d8c20bc88d32294f4f3b819284548122229decd1adf1a7eb0848bc4fbd7ac5bae3a854f2bcb0831c4550f48752f630a33a088d0fd166d8d3435d9",
147+
"034fef9cd7c4c63588d3b03feb5281b9d232cba34d6f3d71aee59211ffbfe1fe87",
148+
"0260d0487a3dfce9228eee2d0d83a40f6131f551526c8e52066fe7fe1e4a509666",
149+
"03a2670393d02b162d0ed06a08041e80d86be36c0564335254df7462447eb69ab3",
150+
"033222fc61795077791665544a90740e8ead638a391a3b8f9261f4a226b396c042",
151+
"03f577473348d7b01e7af2f245e36b98d181bc935ec8b552cde5932b646dc7be04",
152+
"0222b1a5486be0a2d5f3c5866be46e05d1bde8cda5ea1c4c77a9bc48d2fa2753bc",
153+
"0377a1c826d3a03ca4ee94fc4dea6bccb2bac5f2ac0419a128c29f8e88f1ff295a",
154+
"031b75c84453935ab76f8c8d0b6566c3fcc101cc5c59d7000bfc9101961e9308d9",
155+
"038905a42433b1d677cc8afd36861430b9a8529171b0616f733659f131c3f80221",
156+
"038be7f348902d8c20bc88d32294f4f3b819284548122229decd1adf1a7eb0848b",
129157
}
130158

131159
for i := uint32(0); i < 10; i++ {
@@ -138,7 +166,7 @@ func Test_UserPK_HDPaths(t *testing.T) {
138166

139167
assert.Equal(
140168
t,
141-
65,
169+
33,
142170
len(pubKey),
143171
"Public key has wrong length: %x, expected length: %x\n", pubKey, 65)
144172

@@ -148,7 +176,7 @@ func Test_UserPK_HDPaths(t *testing.T) {
148176
hex.EncodeToString(pubKey),
149177
"Public key 44'/118'/0'/0/%d does not match\n", i)
150178

151-
_, err = secp256k1.ParsePubKey(pubKey[:], secp256k1.S256())
179+
_, err = btcec.ParsePubKey(pubKey[:], btcec.S256())
152180
require.Nil(t, err, "Error parsing public key err: %s\n", err)
153181

154182
}
@@ -201,19 +229,20 @@ func Test_UserSign(t *testing.T) {
201229
return
202230
}
203231

204-
pub2, err := secp256k1.ParsePubKey(pubKey[:], secp256k1.S256())
232+
pub2, err := btcec.ParsePubKey(pubKey[:], btcec.S256())
205233
if err != nil {
206234
t.Fatalf("[ParsePK] Error: " + err.Error())
207235
return
208236
}
209237

210-
sig2, err := secp256k1.ParseDERSignature(signature[:], secp256k1.S256())
238+
sig2, err := btcec.ParseDERSignature(signature[:], btcec.S256())
211239
if err != nil {
212240
t.Fatalf("[ParseSig] Error: " + err.Error())
213241
return
214242
}
215243

216-
verified := sig2.Verify(crypto.Sha256(message), pub2)
244+
hash := sha256.Sum256(message)
245+
verified := sig2.Verify(hash[:], pub2)
217246
if !verified {
218247
t.Fatalf("[VerifySig] Error verifying signature: " + err.Error())
219248
return
@@ -236,5 +265,5 @@ func Test_UserSign_Fails(t *testing.T) {
236265
message = append(garbage, message...)
237266

238267
_, err = userApp.SignSECP256K1(path, message)
239-
assert.EqualError(t, err, "Unexpected character in JSON string")
268+
assert.EqualError(t, err, "Invalid character in JSON string")
240269
}

validator_app_test.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,9 @@ func Test_ValGetVersion(t *testing.T) {
3333

3434
version, err := validatorApp.GetVersion()
3535
require.Nil(t, err, "Detected error")
36-
assert.Equal(t, uint8(0xFF), version.AppMode, "TESTING MODE NOT ENABLED")
36+
assert.Equal(t, uint8(0x0), version.AppMode, "TESTING MODE NOT ENABLED")
3737
assert.Equal(t, uint8(0x0), version.Major, "Wrong Major version")
38-
assert.Equal(t, uint8(0x5), version.Minor, "Wrong Minor version")
38+
assert.Equal(t, uint8(0x9), version.Minor, "Wrong Minor version")
3939
assert.Equal(t, uint8(0x0), version.Patch, "Wrong Patch version")
4040
}
4141

0 commit comments

Comments
 (0)