Skip to content

Commit

Permalink
[sky] refs #279 - Generate mocks for Skycoin altcoin plugin
Browse files Browse the repository at this point in the history
Update test code
  • Loading branch information
olemis committed Feb 3, 2020
1 parent cf6ce80 commit 081e56a
Show file tree
Hide file tree
Showing 6 changed files with 695 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/coin/skycoin/models/api.go
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
package skycoin

import "github.com/fibercrypto/fibercryptowallet/src/coin/mocks"
import "github.com/fibercrypto/fibercryptowallet/src/coin/skycoin/skymocks"

// "testing"

type SkycoinApiMock struct {
mocks.SkycoinAPI
skymocks.SkycoinAPI
}

func (m *SkycoinApiMock) Create() (interface{}, error) {
Expand Down
7 changes: 4 additions & 3 deletions src/coin/skycoin/models/coin_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import (
"github.com/SkycoinProject/skycoin/src/coin"
"github.com/SkycoinProject/skycoin/src/readable"
"github.com/fibercrypto/fibercryptowallet/src/coin/mocks"
"github.com/fibercrypto/fibercryptowallet/src/coin/skycoin/skymocks"
"github.com/fibercrypto/fibercryptowallet/src/coin/skycoin/skytypes"
"github.com/fibercrypto/fibercryptowallet/src/core"
"github.com/fibercrypto/fibercryptowallet/src/errors"
Expand Down Expand Up @@ -810,7 +811,7 @@ func TestPendingTxnToCreatedTransaction(t *testing.T) {
}

func Test_serializeCreatedTransaction(t *testing.T) {
mockTxn := new(mocks.ReadableTxn)
mockTxn := new(skymocks.ReadableTxn)
id := "0000000000000000000000000000000000000000000000000000000000000000"
created := &api.CreatedTransaction{
TxID: "78877fa898f0b4c45c9c33ae941e40617ad7c8657a307db62bc5691f92f4f60e",
Expand Down Expand Up @@ -855,7 +856,7 @@ func TestSkycoinPendingTransactionEncodeSkycoinTransaction(t *testing.T) {
}

func Test_verifyReadableTransaction(t *testing.T) {
mockTxn := new(mocks.ReadableTxn)
mockTxn := new(skymocks.ReadableTxn)
id := "0000000000000000000000000000000000000000000000000000000000000000"
created := &api.CreatedTransaction{
TxID: "78877fa898f0b4c45c9c33ae941e40617ad7c8657a307db62bc5691f92f4f60e",
Expand Down Expand Up @@ -920,7 +921,7 @@ func TestPendingTxnVerifySignature(t *testing.T) {
}

func Test_checkFullySigned(t *testing.T) {
mockTxn := new(mocks.ReadableTxn)
mockTxn := new(skymocks.ReadableTxn)
id := "0000000000000000000000000000000000000000000000000000000000000000"
created := &api.CreatedTransaction{
TxID: "78877fa898f0b4c45c9c33ae941e40617ad7c8657a307db62bc5691f92f4f60e",
Expand Down
34 changes: 34 additions & 0 deletions src/coin/skycoin/skymocks/ReadableTxn.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 081e56a

Please sign in to comment.