Fix tests
This commit is contained in:
parent
f37487e905
commit
283cdf433d
1 changed files with 14 additions and 7 deletions
|
@ -27,7 +27,7 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
middlewareVersion = "0.0.2"
|
middlewareVersion = "0.0.3"
|
||||||
defaultNetworkOptions = &types.NetworkOptionsResponse{
|
defaultNetworkOptions = &types.NetworkOptionsResponse{
|
||||||
Version: &types.Version{
|
Version: &types.Version{
|
||||||
RosettaVersion: "1.4.4",
|
RosettaVersion: "1.4.4",
|
||||||
|
@ -80,6 +80,7 @@ func TestNetworkEndpoints_Online(t *testing.T) {
|
||||||
cfg := &configuration.Configuration{
|
cfg := &configuration.Configuration{
|
||||||
Mode: configuration.Online,
|
Mode: configuration.Online,
|
||||||
Network: networkIdentifier,
|
Network: networkIdentifier,
|
||||||
|
GenesisBlockIdentifier: bitcoin.MainnetGenesisBlockIdentifier,
|
||||||
}
|
}
|
||||||
mockIndexer := &mocks.Indexer{}
|
mockIndexer := &mocks.Indexer{}
|
||||||
mockClient := &mocks.Client{}
|
mockClient := &mocks.Client{}
|
||||||
|
@ -92,9 +93,6 @@ func TestNetworkEndpoints_Online(t *testing.T) {
|
||||||
networkIdentifier,
|
networkIdentifier,
|
||||||
}, networkList.NetworkIdentifiers)
|
}, networkList.NetworkIdentifiers)
|
||||||
|
|
||||||
rawStatus := &types.NetworkStatusResponse{
|
|
||||||
GenesisBlockIdentifier: bitcoin.MainnetGenesisBlockIdentifier,
|
|
||||||
}
|
|
||||||
blockResponse := &types.BlockResponse{
|
blockResponse := &types.BlockResponse{
|
||||||
Block: &types.Block{
|
Block: &types.Block{
|
||||||
BlockIdentifier: &types.BlockIdentifier{
|
BlockIdentifier: &types.BlockIdentifier{
|
||||||
|
@ -103,7 +101,11 @@ func TestNetworkEndpoints_Online(t *testing.T) {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
mockClient.On("NetworkStatus", ctx).Return(rawStatus, nil)
|
mockClient.On("GetPeers", ctx).Return([]*types.Peer{
|
||||||
|
{
|
||||||
|
PeerID: "77.93.223.9:8333",
|
||||||
|
},
|
||||||
|
}, nil)
|
||||||
mockIndexer.On(
|
mockIndexer.On(
|
||||||
"GetBlockLazy",
|
"GetBlockLazy",
|
||||||
ctx,
|
ctx,
|
||||||
|
@ -117,6 +119,11 @@ func TestNetworkEndpoints_Online(t *testing.T) {
|
||||||
assert.Equal(t, &types.NetworkStatusResponse{
|
assert.Equal(t, &types.NetworkStatusResponse{
|
||||||
GenesisBlockIdentifier: bitcoin.MainnetGenesisBlockIdentifier,
|
GenesisBlockIdentifier: bitcoin.MainnetGenesisBlockIdentifier,
|
||||||
CurrentBlockIdentifier: blockResponse.Block.BlockIdentifier,
|
CurrentBlockIdentifier: blockResponse.Block.BlockIdentifier,
|
||||||
|
Peers: []*types.Peer{
|
||||||
|
{
|
||||||
|
PeerID: "77.93.223.9:8333",
|
||||||
|
},
|
||||||
|
},
|
||||||
}, networkStatus)
|
}, networkStatus)
|
||||||
|
|
||||||
networkOptions, err := servicer.NetworkOptions(ctx, nil)
|
networkOptions, err := servicer.NetworkOptions(ctx, nil)
|
||||||
|
|
Loading…
Reference in a new issue