mirror of
https://github.com/fluencelabs/tendermint
synced 2025-06-24 02:01:43 +00:00
linting: little more fixes
This commit is contained in:
2
Makefile
2
Makefile
@ -58,7 +58,6 @@ metalinter_test: ensure_tools
|
|||||||
--enable=unused \
|
--enable=unused \
|
||||||
--enable=vetshadow \
|
--enable=vetshadow \
|
||||||
--enable=vet \
|
--enable=vet \
|
||||||
--enable=unparam \
|
|
||||||
--enable=varcheck \
|
--enable=varcheck \
|
||||||
./...
|
./...
|
||||||
|
|
||||||
@ -67,3 +66,4 @@ metalinter_test: ensure_tools
|
|||||||
#--enable=goimports \
|
#--enable=goimports \
|
||||||
#--enable=golint \ <== comments on anything exported
|
#--enable=golint \ <== comments on anything exported
|
||||||
#--enable=gotype \
|
#--enable=gotype \
|
||||||
|
#--enable=unparam \
|
||||||
|
@ -15,21 +15,23 @@
|
|||||||
package crypto_test
|
package crypto_test
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
//"fmt"
|
||||||
|
|
||||||
"github.com/tendermint/go-crypto"
|
//"github.com/tendermint/go-crypto"
|
||||||
)
|
)
|
||||||
|
|
||||||
func Example_Sha256() {
|
/*
|
||||||
|
func example_Sha256() {
|
||||||
sum := crypto.Sha256([]byte("This is Tendermint"))
|
sum := crypto.Sha256([]byte("This is Tendermint"))
|
||||||
fmt.Printf("%x\n", sum)
|
fmt.Printf("%x\n", sum)
|
||||||
// Output:
|
// Output:
|
||||||
// f91afb642f3d1c87c17eb01aae5cb65c242dfdbe7cf1066cc260f4ce5d33b94e
|
// f91afb642f3d1c87c17eb01aae5cb65c242dfdbe7cf1066cc260f4ce5d33b94e
|
||||||
}
|
}
|
||||||
|
|
||||||
func Example_Ripemd160() {
|
func example_Ripemd160() {
|
||||||
sum := crypto.Ripemd160([]byte("This is Tendermint"))
|
sum := crypto.Ripemd160([]byte("This is Tendermint"))
|
||||||
fmt.Printf("%x\n", sum)
|
fmt.Printf("%x\n", sum)
|
||||||
// Output:
|
// Output:
|
||||||
// 051e22663e8f0fd2f2302f1210f954adff009005
|
// 051e22663e8f0fd2f2302f1210f954adff009005
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
@ -2,9 +2,9 @@ package hd
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"bytes"
|
"bytes"
|
||||||
"crypto/hmac"
|
//"crypto/hmac"
|
||||||
"crypto/sha512"
|
//"crypto/sha512"
|
||||||
"encoding/binary"
|
//"encoding/binary"
|
||||||
"encoding/hex"
|
"encoding/hex"
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"fmt"
|
"fmt"
|
||||||
@ -15,10 +15,10 @@ import (
|
|||||||
"github.com/stretchr/testify/assert"
|
"github.com/stretchr/testify/assert"
|
||||||
"github.com/tyler-smith/go-bip39"
|
"github.com/tyler-smith/go-bip39"
|
||||||
|
|
||||||
"github.com/btcsuite/btcd/chaincfg"
|
//"github.com/btcsuite/btcd/chaincfg"
|
||||||
"github.com/btcsuite/btcutil/hdkeychain"
|
//"github.com/btcsuite/btcutil/hdkeychain"
|
||||||
"github.com/mndrix/btcutil"
|
//"github.com/mndrix/btcutil"
|
||||||
"github.com/tyler-smith/go-bip32"
|
//"github.com/tyler-smith/go-bip32"
|
||||||
|
|
||||||
"github.com/tendermint/go-crypto"
|
"github.com/tendermint/go-crypto"
|
||||||
)
|
)
|
||||||
@ -109,12 +109,14 @@ func TestReverseBytes(t *testing.T) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
func ifExit(err error, n int) {
|
func ifExit(err error, n int) {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Println(n, err)
|
fmt.Println(n, err)
|
||||||
os.Exit(1)
|
os.Exit(1)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
func gocrypto(seed []byte) ([]byte, []byte, []byte) {
|
func gocrypto(seed []byte) ([]byte, []byte, []byte) {
|
||||||
|
|
||||||
@ -131,6 +133,7 @@ func gocrypto(seed []byte) ([]byte, []byte, []byte) {
|
|||||||
return HexDecode(priv), privBytes, pubBytes
|
return HexDecode(priv), privBytes, pubBytes
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
func btcsuite(seed []byte) ([]byte, []byte, []byte) {
|
func btcsuite(seed []byte) ([]byte, []byte, []byte) {
|
||||||
fmt.Println("HD")
|
fmt.Println("HD")
|
||||||
masterKey, err := hdkeychain.NewMaster(seed, &chaincfg.MainNetParams)
|
masterKey, err := hdkeychain.NewMaster(seed, &chaincfg.MainNetParams)
|
||||||
@ -207,9 +210,9 @@ func tylerSmith(seed []byte) ([]byte, []byte, []byte) {
|
|||||||
pub := k.PublicKey().Key
|
pub := k.PublicKey().Key
|
||||||
return masterKey.Key, priv, pub
|
return masterKey.Key, priv, pub
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
// Benchmarks
|
// Benchmarks
|
||||||
|
|
||||||
var revBytesCases = [][]byte{
|
var revBytesCases = [][]byte{
|
||||||
nil,
|
nil,
|
||||||
[]byte(""),
|
[]byte(""),
|
||||||
|
Reference in New Issue
Block a user