revert action sorting in explorer
revert action sorting in explorer
@@ -10,7 +10,6 @@ import (
"encoding/hex"
"math/big"
"net"
- "sort"
"github.com/golang/protobuf/jsonpb"
"github.com/golang/protobuf/proto"
@@ -59,27 +58,6 @@ var (
)
)
-// ExecutionList implements sort.Interface based on the Timestamp field.
-type ExecutionList []explorer.Execution
-
-func (e ExecutionList) Len() int { return len(e) }
-func (e ExecutionList) Less(i, j int) bool { return e[i].Timestamp > e[j].Timestamp }
-func (e ExecutionList) Swap(i, j int) { e[i], e[j] = e[j], e[i] }
-
-// TransferList implements sort.Interface based on the Timestamp field.
-type TransferList []explorer.Transfer
-
-func (t TransferList) Len() int { return len(t) }
-func (t TransferList) Less(i, j int) bool { return t[i].Timestamp > t[j].Timestamp }
-func (t TransferList) Swap(i, j int) { t[i], t[j] = t[j], t[i] }
-
-// VoteList implements sort.Interface based on the Timestamp field.
-type VoteList []explorer.Vote
-
-func (v VoteList) Len() int { return len(v) }
-func (v VoteList) Less(i, j int) bool { return v[i].Timestamp > v[j].Timestamp }
-func (v VoteList) Swap(i, j int) { v[i], v[j] = v[j], v[i] }
-
func init() {
prometheus.MustRegister(requestMtc)
}
@@ -204,8 +182,6 @@ func (exp *Service) GetLastTransfersByRange(startBlockHeight int64, offset int64
}
}
- // sort Transfer by timestamp
- sort.Sort(TransferList(res))
return res, nil
}
@@ -387,8 +363,6 @@ func (exp *Service) GetLastVotesByRange(startBlockHeight int64, offset int64, li
}
}
- // sort Vote by timestamp
- sort.Sort(VoteList(res))
return res, nil
}
@@ -572,8 +546,6 @@ func (exp *Service) GetLastExecutionsByRange(startBlockHeight int64, offset int6
}
}
- // sort Execution by timestamp
- sort.Sort(ExecutionList(res))
return res, nil
}
