status-go/multiaccounts/accounts/testutils.go

20 lines
391 B
Go
Raw Normal View History

package accounts
import (
"database/sql"
"testing"
"github.com/stretchr/testify/require"
)
func MockTestAccounts(t *testing.T, db *sql.DB, accounts []*Account) {
d, err := NewDB(db)
require.NoError(t, err)
2023-05-24 07:32:11 +00:00
err = d.SaveOrUpdateAccounts(accounts)
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)
}