Skip to content

Commit

Permalink
fix tests: use a skycoin API client from a mock ref fibercrypto#139
Browse files Browse the repository at this point in the history
  • Loading branch information
stdevAlDen committed Feb 14, 2020
1 parent 5be3a38 commit a21d409
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/coin/skycoin/models/testsutils.go
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,10 @@ func SetGlobalMock(mock *SkycoinApiMock) {
global_mock = mock
}

func GetGlobalMock() *SkycoinApiMock {
return global_mock
}

func TransactionSignInputTestSkyHwImpl(t *testing.T, signers []core.TxnSigner, setWallet func(*testing.T, core.TxnSigner, core.Wallet)) {
_, keysData, _, err := makeTransactionMultipleInputs(t, 3)
require.NoError(t, err)
Expand Down
6 changes: 6 additions & 0 deletions src/contrib/skywallet/skywallet_integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,12 @@ func TestMain(m *testing.M) {

func TestTransactionSignInputFromDevice(t *testing.T) {
skycoin.CleanGlobalMock()
skyApiMock := skycoin.GetGlobalMock()
err := core.GetMultiPool().CreateSection(skycoin.PoolSection, skyApiMock)
if err != nil {
logModelTest.WithError(err).Warn("Error creating pool section")
return
}
setUpHardwareWallet(t)
dev := emulatorDevice()
hs1 := NewSkyWallet(nil, dev)
Expand Down

0 comments on commit a21d409

Please sign in to comment.