2023-05-11 07:50:07 +00:00
|
|
|
package accounts
|
|
|
|
|
|
|
|
import (
|
|
|
|
"database/sql"
|
|
|
|
"testing"
|
|
|
|
|
|
|
|
"github.com/stretchr/testify/require"
|
|
|
|
)
|
|
|
|
|
2023-05-28 10:40:50 +00:00
|
|
|
func MockTestAccounts(t *testing.T, db *sql.DB, accounts []*Account) {
|
2023-05-11 07:50:07 +00:00
|
|
|
d, err := NewDB(db)
|
|
|
|
require.NoError(t, err)
|
|
|
|
|
2023-05-24 07:32:11 +00:00
|
|
|
err = d.SaveOrUpdateAccounts(accounts)
|
2023-05-11 07:50:07 +00:00
|
|
|
require.NoError(t, err)
|
|
|
|
res, err := d.GetAccounts()
|
|
|
|
require.NoError(t, err)
|
2023-06-02 07:38:06 +00:00
|
|
|
require.Equal(t, accounts[0].Address, res[0].Address)
|
2023-05-11 07:50:07 +00:00
|
|
|
}
|