Feature/merge history l2 tables (#156)

* WIP rebase

* Combine both SQL DBs

* API and DB refactor
This commit is contained in:
a_bennassar
2020-09-29 18:27:07 +02:00
committed by GitHub
parent 8efbb7ab18
commit c6f70f3177
34 changed files with 1493 additions and 990 deletions

23
test/dbUtils.go Normal file
View File

@@ -0,0 +1,23 @@
package test
import (
"testing"
"github.com/stretchr/testify/assert"
)
// AssertUSD asserts pointers to float64, and checks that they are equal
// with a tolerance of 0.01%. After that, the actual value is setted to the expected value
// in order to be able to perform further assertions using the standar assert functions.
func AssertUSD(t *testing.T, expected, actual *float64) {
if actual == nil {
assert.Equal(t, expected, actual)
return
}
if *expected < *actual {
assert.InEpsilon(t, *actual, *expected, 0.0001)
} else if *expected > *actual {
assert.InEpsilon(t, *expected, *actual, 0.0001)
}
*expected = *actual
}