mirror of
https://github.com/arnaucube/hermez-node.git
synced 2026-02-06 19:06:42 +01:00
Replace all []*Foo by []Foo in sql db return values
- Implement SlicePtrsToSlice and use it in all `meddler.QueryAll` sql db functions to always return []Foo instead of []*Foo
This commit is contained in:
@@ -197,7 +197,7 @@ func TestMain(m *testing.M) {
|
||||
genericTxs = append(genericTxs, l2tx.Tx())
|
||||
}
|
||||
// Transform generic Txs to HistoryTx
|
||||
historyTxs := []*historydb.HistoryTx{}
|
||||
historyTxs := []historydb.HistoryTx{}
|
||||
for _, genericTx := range genericTxs {
|
||||
// find timestamp
|
||||
var timestamp time.Time
|
||||
@@ -238,7 +238,7 @@ func TestMain(m *testing.M) {
|
||||
*feeUSD = *usd * genericTx.Fee.Percentage()
|
||||
}
|
||||
}
|
||||
historyTxs = append(historyTxs, &historydb.HistoryTx{
|
||||
historyTxs = append(historyTxs, historydb.HistoryTx{
|
||||
IsL1: genericTx.IsL1,
|
||||
TxID: genericTx.TxID,
|
||||
Type: genericTx.Type,
|
||||
|
||||
@@ -69,7 +69,7 @@ type historyTxAPI struct {
|
||||
Token common.Token `json:"token"`
|
||||
}
|
||||
|
||||
func historyTxsToAPI(dbTxs []*historydb.HistoryTx) []historyTxAPI {
|
||||
func historyTxsToAPI(dbTxs []historydb.HistoryTx) []historyTxAPI {
|
||||
apiTxs := []historyTxAPI{}
|
||||
for i := 0; i < len(dbTxs); i++ {
|
||||
apiTx := historyTxAPI{
|
||||
|
||||
Reference in New Issue
Block a user