mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-20 10:52:25 +00:00
fix linting issues
This commit is contained in:
parent
18575fb554
commit
cd6be44f06
4 changed files with 11 additions and 7 deletions
|
|
@ -26,17 +26,19 @@ import (
|
|||
_ "github.com/mattn/go-sqlite3"
|
||||
)
|
||||
|
||||
const foo = "foo"
|
||||
|
||||
func TestKeyStoreDB(t *testing.T) {
|
||||
ks := tmpKeyStoreDB(t)
|
||||
|
||||
acc, err := ks.NewAccount("foo")
|
||||
acc, err := ks.NewAccount(foo)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if !ks.HasAddress(acc.Address) {
|
||||
t.Errorf("HasAccount(%x) should've returned true", acc.Address)
|
||||
}
|
||||
if err := ks.Update(acc, "foo", "bar"); err != nil {
|
||||
if err := ks.Update(acc, foo, "bar"); err != nil {
|
||||
t.Errorf("Update error: %v", err)
|
||||
}
|
||||
if err := ks.Delete(acc, "bar"); err != nil {
|
||||
|
|
@ -93,7 +95,7 @@ func TestSignWithPassphraseDB(t *testing.T) {
|
|||
func TestTimedUnlockDB(t *testing.T) {
|
||||
ks := tmpKeyStoreDB(t)
|
||||
|
||||
pass := "foo"
|
||||
pass := foo
|
||||
acc, err := ks.NewAccount(pass)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
|
|
@ -127,7 +129,7 @@ func TestTimedUnlockDB(t *testing.T) {
|
|||
func TestOverrideUnlockDB(t *testing.T) {
|
||||
ks := tmpKeyStoreDB(t)
|
||||
|
||||
pass := "foo"
|
||||
pass := foo
|
||||
acc, err := ks.NewAccount(pass)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
|
|
|
|||
|
|
@ -81,7 +81,7 @@ func readConfigYAML(path string) (*DBConf, error) {
|
|||
}
|
||||
|
||||
conf := &DBConf{}
|
||||
if err = yaml.Unmarshal([]byte(yamlContent), conf); err != nil {
|
||||
if err = yaml.Unmarshal(yamlContent, conf); err != nil {
|
||||
log.Warn("Cannot parse yaml config: ", err)
|
||||
return nil, err
|
||||
}
|
||||
|
|
|
|||
|
|
@ -503,7 +503,6 @@ func signer(c *cli.Context) error {
|
|||
var (
|
||||
api core.ExternalAPI
|
||||
pwStorage storage.Storage = storage.NewNoStorage()
|
||||
jsStorage storage.Storage = storage.NewNoStorage()
|
||||
configStorage storage.Storage = storage.NewNoStorage()
|
||||
)
|
||||
configDir := c.GlobalString(configdirFlag.Name)
|
||||
|
|
@ -512,7 +511,7 @@ func signer(c *cli.Context) error {
|
|||
} else {
|
||||
// create dedicated storages for different type of configuration
|
||||
pwStorage = initPasswordStorage(stretchedKey, c)
|
||||
jsStorage = initJsStorage(stretchedKey, c)
|
||||
jsStorage := initJsStorage(stretchedKey, c)
|
||||
configStorage = initConfigStorage(stretchedKey, c)
|
||||
|
||||
// Do we have a rule-file?
|
||||
|
|
|
|||
|
|
@ -76,6 +76,9 @@ func TestEnd2End(t *testing.T) {
|
|||
|
||||
// make sure intermediate result is encrypted correctly
|
||||
encrypted, err := fs.api.Get("bazonk")
|
||||
if err != nil {
|
||||
t.Error("Failed to retrieve encrypted credential")
|
||||
}
|
||||
cred := StoredCredential{}
|
||||
if err = json.Unmarshal([]byte(encrypted), &cred); err != nil {
|
||||
t.Error("Failed to unmarshal encrypted credential", "err", err)
|
||||
|
|
|
|||
Loading…
Reference in a new issue