forked from cerc-io/laconicd-deprecated
Update golangci-lint config and fix linting issues (#168)
* update golangci * update golang lint yml and updated linting issues
This commit is contained in:
+2
-2
@@ -279,7 +279,7 @@ func (e *PublicEthAPI) SendTransaction(args params.SendTxArgs) (common.Hash, err
|
||||
intChainID, ok := new(big.Int).SetString(chainID, 10)
|
||||
if !ok {
|
||||
return common.Hash{}, fmt.Errorf(
|
||||
fmt.Sprintf("Invalid chainID: %s, must be integer format", chainID))
|
||||
fmt.Sprintf("invalid chainID: %s, must be integer format", chainID))
|
||||
}
|
||||
|
||||
// Sign transaction
|
||||
@@ -592,7 +592,7 @@ func bytesToEthTx(cliCtx context.CLIContext, bz []byte) (*types.EthereumTxMsg, e
|
||||
err := cliCtx.Codec.UnmarshalBinaryLengthPrefixed(bz, &stdTx)
|
||||
ethTx, ok := stdTx.(*types.EthereumTxMsg)
|
||||
if !ok || err != nil {
|
||||
return nil, fmt.Errorf("Invalid transaction type, must be an amino encoded Ethereum transaction")
|
||||
return nil, fmt.Errorf("invalid transaction type, must be an amino encoded Ethereum transaction")
|
||||
}
|
||||
return ethTx, nil
|
||||
}
|
||||
|
||||
+15
-16
@@ -39,23 +39,22 @@ func (e *PublicFilterAPI) GetLogs(criteria filters.FilterCriteria) ([]*ethtypes.
|
||||
results := e.getLogs()
|
||||
logs := filterLogs(results, nil, nil, filter.addresses, filter.topics)
|
||||
return logs, nil
|
||||
} else {
|
||||
// Convert the RPC block numbers into internal representations
|
||||
begin := rpc.LatestBlockNumber.Int64()
|
||||
if criteria.FromBlock != nil {
|
||||
begin = criteria.FromBlock.Int64()
|
||||
}
|
||||
from := big.NewInt(begin)
|
||||
end := rpc.LatestBlockNumber.Int64()
|
||||
if criteria.ToBlock != nil {
|
||||
end = criteria.ToBlock.Int64()
|
||||
}
|
||||
to := big.NewInt(end)
|
||||
results := e.getLogs()
|
||||
logs := filterLogs(results, from, to, criteria.Addresses, criteria.Topics)
|
||||
|
||||
return returnLogs(logs), nil
|
||||
}
|
||||
// Convert the RPC block numbers into internal representations
|
||||
begin := rpc.LatestBlockNumber.Int64()
|
||||
if criteria.FromBlock != nil {
|
||||
begin = criteria.FromBlock.Int64()
|
||||
}
|
||||
from := big.NewInt(begin)
|
||||
end := rpc.LatestBlockNumber.Int64()
|
||||
if criteria.ToBlock != nil {
|
||||
end = criteria.ToBlock.Int64()
|
||||
}
|
||||
to := big.NewInt(end)
|
||||
results := e.getLogs()
|
||||
logs := filterLogs(results, from, to, criteria.Addresses, criteria.Topics)
|
||||
|
||||
return returnLogs(logs), nil
|
||||
}
|
||||
|
||||
func (e *PublicFilterAPI) getLogs() (results []*ethtypes.Log) {
|
||||
|
||||
@@ -63,6 +63,7 @@ func call(method string, params []string) (*Response, error) {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
/* #nosec */
|
||||
res, err := http.Post(addr, "application/json", bytes.NewBuffer(req))
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -122,7 +123,6 @@ func TestEth_blockNumber(t *testing.T) {
|
||||
}
|
||||
|
||||
t.Logf("Got block number: %s\n", res.String())
|
||||
|
||||
}
|
||||
|
||||
func TestEth_GetBalance(t *testing.T) {
|
||||
@@ -144,7 +144,6 @@ func TestEth_GetBalance(t *testing.T) {
|
||||
if res.ToInt().Cmp(big.NewInt(0)) != 0 {
|
||||
t.Errorf("expected balance: %d, got: %s", 0, res.String())
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
func TestEth_GetStorageAt(t *testing.T) {
|
||||
|
||||
+1
-1
@@ -49,7 +49,7 @@ func (bn *BlockNumber) UnmarshalJSON(data []byte) error {
|
||||
return err
|
||||
}
|
||||
if blckNum > math.MaxInt64 {
|
||||
return fmt.Errorf("Blocknumber too high")
|
||||
return fmt.Errorf("blocknumber too high")
|
||||
}
|
||||
|
||||
*bn = BlockNumber(blckNum)
|
||||
|
||||
Reference in New Issue
Block a user