Skip to content

Commit 1add2df

Browse files
committed
go fmt ./...
Signed-off-by: abicky <[email protected]>
1 parent 9abab97 commit 1add2df

File tree

4 files changed

+24
-25
lines changed

4 files changed

+24
-25
lines changed

pkg/hd/config.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ package hd
33
import (
44
fmt "fmt"
55

6-
"github.com/hyperledger-labs/yui-relayer/signer"
76
"github.com/datachainlab/ibc-hd-signer/pkg/wallet"
7+
"github.com/hyperledger-labs/yui-relayer/signer"
88
)
99

1010
var _ signer.SignerConfig = (*SignerConfig)(nil)

pkg/hd/signer.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,15 @@ import (
44
"crypto/ecdsa"
55
"fmt"
66

7-
"github.com/hyperledger-labs/yui-relayer/signer"
87
"github.com/datachainlab/ibc-hd-signer/pkg/wallet"
98
gethcrypto "github.com/ethereum/go-ethereum/crypto"
9+
"github.com/hyperledger-labs/yui-relayer/signer"
1010
)
1111

1212
var _ signer.Signer = (*Signer)(nil)
1313

1414
type Signer struct {
15-
key *ecdsa.PrivateKey
15+
key *ecdsa.PrivateKey
1616
}
1717

1818
func NewSigner(mnemonic, path string) (*Signer, error) {

pkg/hd/signer_test.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
package hd
22

33
import (
4-
"testing"
54
"encoding/hex"
65
"slices"
6+
"testing"
77
)
88

99
func TestGetPublicKey(t *testing.T) {
@@ -89,4 +89,3 @@ func TestSign(t *testing.T) {
8989
}
9090
}
9191
}
92-

pkg/wallet/wallet_test.go

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
package wallet
22

33
import (
4-
"testing"
5-
"math/big"
64
"encoding/hex"
5+
"math/big"
6+
"testing"
77
)
88

99
func TestParseHDPathLevel(t *testing.T) {
@@ -15,27 +15,27 @@ func TestParseHDPathLevel(t *testing.T) {
1515
{
1616
isErr: false,
1717
data: "m/44'/60'/0'/0/0",
18-
expected: HDPathLevel { 44, 60, 0, 0, 0 },
18+
expected: HDPathLevel{44, 60, 0, 0, 0},
1919
},
2020
{
2121
isErr: true, // invalid path level
2222
data: "m/44'/60'/0'/0/0/7parts",
23-
expected: HDPathLevel { 44, 60, 0, 0, 0 },
23+
expected: HDPathLevel{44, 60, 0, 0, 0},
2424
},
2525
{
2626
isErr: true, // prefix should be 'm'
2727
data: "M/44'/60'/0'/0/0",
28-
expected: HDPathLevel { 44, 60, 0, 0, 0 },
28+
expected: HDPathLevel{44, 60, 0, 0, 0},
2929
},
3030
{
3131
isErr: true, // missing apostrophe: 44
3232
data: "m/44/60/0/0/0",
33-
expected: HDPathLevel { 44, 60, 0, 0, 0 },
33+
expected: HDPathLevel{44, 60, 0, 0, 0},
3434
},
3535
{
3636
isErr: true, // strconv.Atoi: parsing "str": invalid syntax
3737
data: "m/str'/60'/0'/0/0",
38-
expected: HDPathLevel { 44, 60, 0, 0, 0 },
38+
expected: HDPathLevel{44, 60, 0, 0, 0},
3939
},
4040
}
4141

@@ -55,20 +55,20 @@ func TestParseHDPathLevel(t *testing.T) {
5555

5656
func TestValidate(t *testing.T) {
5757
cases := []struct {
58-
data HDPathLevel
59-
isErr bool
58+
data HDPathLevel
59+
isErr bool
6060
}{
6161
{
62-
isErr: false,
63-
data: HDPathLevel{44, 60, 0, 0, 0},
62+
isErr: false,
63+
data: HDPathLevel{44, 60, 0, 0, 0},
6464
},
6565
{
66-
isErr: true, // purpose should be 44
67-
data: HDPathLevel{41, 60, 0, 0, 0},
66+
isErr: true, // purpose should be 44
67+
data: HDPathLevel{41, 60, 0, 0, 0},
6868
},
6969
{
70-
isErr: true, // change should be 0 or 1
71-
data: HDPathLevel{44, 60, 0, 99, 0},
70+
isErr: true, // change should be 0 or 1
71+
data: HDPathLevel{44, 60, 0, 99, 0},
7272
},
7373
}
7474

@@ -92,9 +92,9 @@ func TestGetPrvKeyFromHDWallet(t *testing.T) {
9292
isErr bool
9393
}{
9494
{
95-
isErr: false,
96-
seed: "5d192f43318024f6919e92a6bdf9474b34b704295abb3e21599290d7a3262b567e6c6de54545e946d54b559f06ae475e57d3964875e889a724bbe7108374965c",
97-
path: HDPathLevel{44, 60, 0, 0, 0},
95+
isErr: false,
96+
seed: "5d192f43318024f6919e92a6bdf9474b34b704295abb3e21599290d7a3262b567e6c6de54545e946d54b559f06ae475e57d3964875e889a724bbe7108374965c",
97+
path: HDPathLevel{44, 60, 0, 0, 0},
9898
expect: "103621489529634167205139750085116413410837146389409995551260132005794187042961",
9999
},
100100
}
@@ -134,8 +134,8 @@ func TestGetPrvKeyFromMnemonicAndHDPath(t *testing.T) {
134134
{
135135
isErr: false,
136136
mnemonic: "math razor capable expose worth grape metal sunset metal sudden usage scheme",
137-
path: "m/44'/60'/0'/0/0",
138-
expect: "103621489529634167205139750085116413410837146389409995551260132005794187042961",
137+
path: "m/44'/60'/0'/0/0",
138+
expect: "103621489529634167205139750085116413410837146389409995551260132005794187042961",
139139
},
140140
}
141141

0 commit comments

Comments
 (0)