Fix linting errors

This commit is contained in:
Martin Boehm 2019-12-17 15:37:09 +01:00
parent 15e2c0bf41
commit 0340cef13c
2 changed files with 12 additions and 12 deletions

View File

@ -66,7 +66,7 @@ func TestBalanceHistories_SortAndAggregate(t *testing.T) {
{ {
name: "one", name: "one",
a: []BalanceHistory{ a: []BalanceHistory{
BalanceHistory{ {
ReceivedSat: (*Amount)(big.NewInt(1)), ReceivedSat: (*Amount)(big.NewInt(1)),
SentSat: (*Amount)(big.NewInt(2)), SentSat: (*Amount)(big.NewInt(2)),
Time: 1521514812, Time: 1521514812,
@ -76,7 +76,7 @@ func TestBalanceHistories_SortAndAggregate(t *testing.T) {
}, },
groupByTime: 3600, groupByTime: 3600,
want: []BalanceHistory{ want: []BalanceHistory{
BalanceHistory{ {
ReceivedSat: (*Amount)(big.NewInt(1)), ReceivedSat: (*Amount)(big.NewInt(1)),
SentSat: (*Amount)(big.NewInt(2)), SentSat: (*Amount)(big.NewInt(2)),
Time: 1521514800, Time: 1521514800,
@ -87,42 +87,42 @@ func TestBalanceHistories_SortAndAggregate(t *testing.T) {
{ {
name: "aggregate", name: "aggregate",
a: []BalanceHistory{ a: []BalanceHistory{
BalanceHistory{ {
ReceivedSat: (*Amount)(big.NewInt(1)), ReceivedSat: (*Amount)(big.NewInt(1)),
SentSat: (*Amount)(big.NewInt(2)), SentSat: (*Amount)(big.NewInt(2)),
Time: 1521504812, Time: 1521504812,
Txid: "0011223344556677889900112233445566778899001122334455667788990011", Txid: "0011223344556677889900112233445566778899001122334455667788990011",
Txs: 1, Txs: 1,
}, },
BalanceHistory{ {
ReceivedSat: (*Amount)(big.NewInt(3)), ReceivedSat: (*Amount)(big.NewInt(3)),
SentSat: (*Amount)(big.NewInt(4)), SentSat: (*Amount)(big.NewInt(4)),
Time: 1521504812, Time: 1521504812,
Txid: "00b2c06055e5e90e9c82bd4181fde310104391a7fa4f289b1704e5d90caa3840", Txid: "00b2c06055e5e90e9c82bd4181fde310104391a7fa4f289b1704e5d90caa3840",
Txs: 1, Txs: 1,
}, },
BalanceHistory{ {
ReceivedSat: (*Amount)(big.NewInt(5)), ReceivedSat: (*Amount)(big.NewInt(5)),
SentSat: (*Amount)(big.NewInt(6)), SentSat: (*Amount)(big.NewInt(6)),
Time: 1521514812, Time: 1521514812,
Txid: "00b2c06055e5e90e9c82bd4181fde310104391a7fa4f289b1704e5d90caa3840", Txid: "00b2c06055e5e90e9c82bd4181fde310104391a7fa4f289b1704e5d90caa3840",
Txs: 1, Txs: 1,
}, },
BalanceHistory{ {
ReceivedSat: (*Amount)(big.NewInt(7)), ReceivedSat: (*Amount)(big.NewInt(7)),
SentSat: (*Amount)(big.NewInt(8)), SentSat: (*Amount)(big.NewInt(8)),
Time: 1521504812, Time: 1521504812,
Txid: "00b2c06055e5e90e9c82bd4181fde310104391a7fa4f289b1704e5d90caa3840", Txid: "00b2c06055e5e90e9c82bd4181fde310104391a7fa4f289b1704e5d90caa3840",
Txs: 1, Txs: 1,
}, },
BalanceHistory{ {
ReceivedSat: (*Amount)(big.NewInt(9)), ReceivedSat: (*Amount)(big.NewInt(9)),
SentSat: (*Amount)(big.NewInt(10)), SentSat: (*Amount)(big.NewInt(10)),
Time: 1521534812, Time: 1521534812,
Txid: "0011223344556677889900112233445566778899001122334455667788990011", Txid: "0011223344556677889900112233445566778899001122334455667788990011",
Txs: 1, Txs: 1,
}, },
BalanceHistory{ {
ReceivedSat: (*Amount)(big.NewInt(11)), ReceivedSat: (*Amount)(big.NewInt(11)),
SentSat: (*Amount)(big.NewInt(12)), SentSat: (*Amount)(big.NewInt(12)),
Time: 1521534812, Time: 1521534812,
@ -132,19 +132,19 @@ func TestBalanceHistories_SortAndAggregate(t *testing.T) {
}, },
groupByTime: 3600, groupByTime: 3600,
want: []BalanceHistory{ want: []BalanceHistory{
BalanceHistory{ {
ReceivedSat: (*Amount)(big.NewInt(11)), ReceivedSat: (*Amount)(big.NewInt(11)),
SentSat: (*Amount)(big.NewInt(14)), SentSat: (*Amount)(big.NewInt(14)),
Time: 1521504000, Time: 1521504000,
Txs: 2, Txs: 2,
}, },
BalanceHistory{ {
ReceivedSat: (*Amount)(big.NewInt(5)), ReceivedSat: (*Amount)(big.NewInt(5)),
SentSat: (*Amount)(big.NewInt(6)), SentSat: (*Amount)(big.NewInt(6)),
Time: 1521514800, Time: 1521514800,
Txs: 1, Txs: 1,
}, },
BalanceHistory{ {
ReceivedSat: (*Amount)(big.NewInt(20)), ReceivedSat: (*Amount)(big.NewInt(20)),
SentSat: (*Amount)(big.NewInt(22)), SentSat: (*Amount)(big.NewInt(22)),
Time: 1521532800, Time: 1521532800,

View File

@ -1149,7 +1149,7 @@ func (w *Worker) GetFiatRatesForBlockID(bid string, currency string) (*db.Result
if currency == "" { if currency == "" {
return nil, NewAPIError("Missing or empty \"currency\" parameter", true) return nil, NewAPIError("Missing or empty \"currency\" parameter", true)
} }
ticker := &db.CurrencyRatesTicker{} var ticker *db.CurrencyRatesTicker
bi, err := w.getBlockInfoFromBlockID(bid) bi, err := w.getBlockInfoFromBlockID(bid)
if err != nil { if err != nil {
if err == bchain.ErrBlockNotFound { if err == bchain.ErrBlockNotFound {