Resolved an additional fail test related to multiaccounts in the Messenger

This commit is contained in:
Samuel Hawksby-Robinson 2020-11-26 17:10:03 +00:00 committed by Andrea Maria Piana
parent 0c1ebaa547
commit 43b8e94b2b
1 changed files with 8 additions and 0 deletions

View File

@ -6,6 +6,7 @@ import (
"encoding/hex" "encoding/hex"
"encoding/json" "encoding/json"
"errors" "errors"
"io/ioutil"
"math/big" "math/big"
"strconv" "strconv"
"strings" "strings"
@ -22,6 +23,7 @@ import (
"github.com/status-im/status-go/eth-node/crypto" "github.com/status-im/status-go/eth-node/crypto"
"github.com/status-im/status-go/eth-node/types" "github.com/status-im/status-go/eth-node/types"
enstypes "github.com/status-im/status-go/eth-node/types/ens" enstypes "github.com/status-im/status-go/eth-node/types/ens"
"github.com/status-im/status-go/multiaccounts"
"github.com/status-im/status-go/protocol/common" "github.com/status-im/status-go/protocol/common"
"github.com/status-im/status-go/protocol/protobuf" "github.com/status-im/status-go/protocol/protobuf"
"github.com/status-im/status-go/protocol/tt" "github.com/status-im/status-go/protocol/tt"
@ -108,10 +110,16 @@ func (s *MessengerSuite) SetupTest() {
} }
func (s *MessengerSuite) newMessengerWithKey(shh types.Waku, privateKey *ecdsa.PrivateKey) *Messenger { func (s *MessengerSuite) newMessengerWithKey(shh types.Waku, privateKey *ecdsa.PrivateKey) *Messenger {
tmpfile, err := ioutil.TempFile("", "accounts-tests-")
s.Require().NoError(err)
madb, err := multiaccounts.InitializeDB(tmpfile.Name())
s.Require().NoError(err)
options := []Option{ options := []Option{
WithCustomLogger(s.logger), WithCustomLogger(s.logger),
WithMessagesPersistenceEnabled(), WithMessagesPersistenceEnabled(),
WithDatabaseConfig(":memory:", "some-key"), WithDatabaseConfig(":memory:", "some-key"),
WithMultiAccounts(madb),
} }
if s.enableDataSync { if s.enableDataSync {
options = append(options, WithDatasync()) options = append(options, WithDatasync())