Conversation
nonceLock := new(AddrLocker) | ||
api := NewPrivateAccountAPI(b, nonceLock) | ||
assert.NotPanics(t, func() { | ||
api.DeriveAccount("https://test.ru", "/test", nil) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Error return value of api.DeriveAccount
is not checked (from errcheck
)
api.am = b.AM | ||
|
||
addr, _ := api.NewAccount("1234") | ||
api.ImportRawKey("11223344556677889900aabbccddff0011223344556677889900aabbccddff00", "1234") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Error return value of api.ImportRawKey
is not checked (from errcheck
)
|
||
api := NewPublicBlockChainAPI(b) | ||
assert.NotPanics(t, func() { | ||
api.Call(ctx, CallArgs{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Error return value of api.Call
is not checked (from errcheck
)
balance := &hexutil.Big{} | ||
|
||
assert.NotPanics(t, func() { | ||
DoCall(ctx, b, CallArgs{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Error return value of DoCall
is not checked (from errcheck
)
assert.NotPanics(t, func() { | ||
b.Returned("StateAndHeaderByNumber", nil, nil) | ||
b.Error("StateAndHeaderByNumber", ErrBackendTest) | ||
DoCall(ctx, b, CallArgs{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Error return value of DoCall
is not checked (from errcheck
)
func (b *testBackend) Returned(method string, args ...interface{}) { | ||
b.result.err[method] = nil | ||
b.result.panic[method] = "" | ||
b.result.returned[method] = make([]interface{}, len(args), len(args)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
S1019: should use make([]interface{}, len(args)) instead (from gosimple
)
} | ||
|
||
func (w *testWallet) SignData(account accounts.Account, mimeType string, data []byte) ([]byte, error) { | ||
return make([]byte, 128, 128), nil |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
S1019: should use make([]byte, 128) instead (from gosimple
)
} | ||
|
||
func (w *testWallet) SignDataWithPassphrase(account accounts.Account, passphrase, mimeType string, data []byte) ([]byte, error) { | ||
return make([]byte, 128, 128), nil |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
S1019: should use make([]byte, 128) instead (from gosimple
)
} | ||
|
||
func (w *testWallet) SignText(account accounts.Account, text []byte) ([]byte, error) { | ||
return make([]byte, 128, 128), nil |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
S1019: should use make([]byte, 128) instead (from gosimple
)
b.result.err[method] = nil | ||
b.result.panic[method] = "" | ||
b.result.returned[method] = make([]interface{}, len(args), len(args)) | ||
for i, v := range args { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
S1001: should use copy() instead of a loop (from gosimple
)
Codecov Report
@@ Coverage Diff @@
## develop #455 +/- ##
===========================================
- Coverage 44.36% 43.80% -0.57%
===========================================
Files 168 171 +3
Lines 11637 11874 +237
===========================================
+ Hits 5163 5201 +38
- Misses 6063 6248 +185
- Partials 411 425 +14
Continue to review full report at Codecov.
|
Tests for ethapi module methods.