Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
64 changes: 60 additions & 4 deletions .mockery.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,65 @@ template: testify
packages:
github.com/wavesplatform/gowaves/pkg/networking:
interfaces:
Handler: {}
Header: {}
Protocol: {}
Handler: { }
Header: { }
Protocol: { }
github.com/wavesplatform/gowaves/pkg/blockchaininfo:
interfaces:
UpdatesPublisherInterface: {}
UpdatesPublisherInterface: { }
github.com/wavesplatform/gowaves/pkg/state:
interfaces:
State:
config:
filename: mock_state.go
scriptStorageState:
config:
structname: MockScriptStorageState
filename: mock_script_storage_state_test.go
featuresState:
config:
structname: MockFeaturesState
filename: mock_features_state_test.go
github.com/wavesplatform/gowaves/pkg/consensus:
interfaces:
stateInfoProvider:
config:
filename: mock_state_info_provider_test.go
github.com/wavesplatform/gowaves/pkg/ride:
interfaces:
environment:
config:
structname: MockEnvironment
filename: mock_environment_test.go
github.com/wavesplatform/gowaves/pkg/grpc/server:
interfaces:
GrpcHandlers:
config:
filename: mock_grpc_handlers_test.go
github.com/wavesplatform/gowaves/pkg/node/peers:
interfaces:
PeerManager:
config:
filename: mock_peer_manager.go
PeerStorage:
config:
filename: mock_peer_storage_test.go
github.com/wavesplatform/gowaves/pkg/p2p/conn:
interfaces:
deadlineReader:
config:
structname: MockDeadlineReader
filename: mock_deadline_reader_test.go
github.com/wavesplatform/gowaves/pkg/p2p/peer:
interfaces:
Peer:
config:
filename: mock_peer_exported.go
github.com/wavesplatform/gowaves/pkg/types:
interfaces:
SmartState:
config:
filename: mock_smart_state.go
EnrichedSmartState:
config:
filename: mock_enriched_smart_state.go
6 changes: 0 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -256,12 +256,6 @@ dist: clean dist-chaincmp dist-importer dist-node dist-wallet dist-compiler
build: vendor ver build-chaincmp-native build-blockcmp-native build-node-native build-importer-native build-wallet-native build-rollback-native build-compiler-native build-statehash-native build-convert-native

mock:
mockgen -source pkg/miner/utxpool/cleaner.go -destination pkg/miner/utxpool/mock.go -package utxpool stateWrapper
mockgen -source pkg/node/peers/peer_manager.go -destination pkg/mock/peer_manager.go -package mock PeerManager
mockgen -source pkg/node/peers/peer_storage.go -destination pkg/mock/peer_storage.go -package mock PeerStorage
mockgen -source pkg/p2p/peer/peer.go -destination pkg/mock/peer.go -package mock Peer
mockgen -source pkg/state/api.go -destination pkg/mock/state.go -package mock State
mockgen -source pkg/grpc/server/api.go -destination pkg/mock/grpc.go -package mock GrpcHandlers
mockery

proto:
Expand Down
1 change: 0 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ require (
github.com/fxamacker/cbor/v2 v2.9.0
github.com/go-chi/chi/v5 v5.2.5
github.com/go-test/deep v1.1.1
github.com/golang/mock v1.6.0
github.com/howeyc/gopass v0.0.0-20210920133722-c8aef6fb66ef
github.com/influxdata/influxdb1-client v0.0.0-20220302092344-a9ab5670611c
github.com/jinzhu/copier v0.4.0
Expand Down
11 changes: 0 additions & 11 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,6 @@ github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5x
github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ=
github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q=
github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q=
github.com/golang/mock v1.6.0 h1:ErTB+efbowRARo13NNdxyJji2egdxLGQhRaY+DUumQc=
github.com/golang/mock v1.6.0/go.mod h1:p6yTPP+5HYm5mzsMV8JkE6ZKdX+/wYM6Hr+LicevLPs=
github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
Expand Down Expand Up @@ -327,7 +325,6 @@ github.com/xenolf/lego v2.7.2+incompatible/go.mod h1:fwiGnfsIjG7OHPfOvgK7Y/Qo6+2
github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k=
go.opentelemetry.io/auto/sdk v1.2.1 h1:jXsnJ4Lmnqd11kwkBV2LgLoFMZKizbCi5fNZ/ipaZ64=
go.opentelemetry.io/auto/sdk v1.2.1/go.mod h1:KRTj+aOaElaLi+wW1kO/DZRXwkF4C5xPbEe3ZiIhN7Y=
go.opentelemetry.io/otel v1.39.0 h1:8yPrr/S0ND9QEfTfdP9V+SiwT4E0G7Y5MO7p85nis48=
Expand Down Expand Up @@ -359,7 +356,6 @@ golang.org/x/exp v0.0.0-20251023183803-a4bb9ffd2546 h1:mgKeJMpvi0yx/sU5GsxQ7p6s2
golang.org/x/exp v0.0.0-20251023183803-a4bb9ffd2546/go.mod h1:j/pmGrbnkbPtQfxEe5D0VQhZC6qKbfKifgD0oM7sR70=
golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
Expand All @@ -368,7 +364,6 @@ golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLL
golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA=
golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=
golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM=
golang.org/x/net v0.49.0 h1:eeHFmOGUTtaaPSGNmjBKpbng9MulQsJURQUAfUwY++o=
golang.org/x/net v0.49.0/go.mod h1:/ysNB2EvaqvesRkuLAyjI1ycPZlQHM3q01F02UY/MV8=
golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
Expand All @@ -377,7 +372,6 @@ golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJ
golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.19.0 h1:vV+1eWNmZ5geRlYjzm2adRgW2/mcpevXNg50YZtPCE4=
golang.org/x/sync v0.19.0/go.mod h1:9KTHXmSnoGruLpwFjVSX0lNNA75CykiMECbovNTZqGI=
golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
Expand All @@ -389,9 +383,6 @@ golang.org/x/sys v0.0.0-20200106162015-b016eb3dc98e/go.mod h1:h1NjWce9XRLGQEsW7w
golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200615200032-f1bc736245b1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20210616094352-59db8d763f22/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
Expand All @@ -400,7 +391,6 @@ golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.21.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/sys v0.41.0 h1:Ivj+2Cp/ylzLiEU89QhWblYnOE9zerudt9Ftecq2C6k=
golang.org/x/sys v0.41.0/go.mod h1:OgkHotnGiDImocRcuBABYBEXf8A9a87e/uXjp9XT3ks=
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
golang.org/x/term v0.40.0 h1:36e4zGLqU4yhjlmxEaagx2KuYbJq3EwY8K943ZsHcvg=
golang.org/x/term v0.40.0/go.mod h1:w2P8uVp06p2iyKKuvXIm7N/y0UCRt3UfJTfZ7oOpglM=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
Expand All @@ -415,7 +405,6 @@ golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtn
golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
golang.org/x/tools v0.0.0-20200729173947-1c30660f9f89/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA=
golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
golang.org/x/tools v0.1.1/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk=
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
Expand Down
13 changes: 3 additions & 10 deletions pkg/api/blocks_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,26 +4,22 @@ import (
"encoding/json"
"testing"

"github.com/golang/mock/gomock"
"github.com/stretchr/testify/require"

"github.com/wavesplatform/gowaves/pkg/crypto"
"github.com/wavesplatform/gowaves/pkg/mock"
"github.com/wavesplatform/gowaves/pkg/proto"
"github.com/wavesplatform/gowaves/pkg/services"
"github.com/wavesplatform/gowaves/pkg/state"
)

func TestApp_BlocksFirst(t *testing.T) {
ctrl := gomock.NewController(t)
defer ctrl.Finish()

g := &proto.Block{
BlockHeader: proto.BlockHeader{
BlockSignature: crypto.MustSignatureFromBase58("5uqnLK3Z9eiot6FyYBfwUnbyid3abicQbAZjz38GQ1Q8XigQMxTK4C1zNkqS1SVw7FqSidbZKxWAKLVoEsp4nNqa"),
},
}

s := mock.NewMockState(ctrl)
s := state.NewMockState(t)
s.EXPECT().BlockByHeight(proto.Height(1)).Return(g, nil)

app, err := NewApp("api-key", nil, services.Services{State: s})
Expand All @@ -35,10 +31,7 @@ func TestApp_BlocksFirst(t *testing.T) {
func TestApp_BlocksLast(t *testing.T) {
g := &proto.Block{}

ctrl := gomock.NewController(t)
defer ctrl.Finish()

s := mock.NewMockState(ctrl)
s := state.NewMockState(t)
s.EXPECT().Height().Return(proto.Height(1), nil)
s.EXPECT().BlockByHeight(proto.Height(1)).Return(g, nil)

Expand Down
10 changes: 3 additions & 7 deletions pkg/api/node_api_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,13 @@ import (
"testing"

"github.com/go-chi/chi/v5"
"github.com/golang/mock/gomock"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"

apiErrs "github.com/wavesplatform/gowaves/pkg/api/errors"
"github.com/wavesplatform/gowaves/pkg/mock"
"github.com/wavesplatform/gowaves/pkg/proto"
"github.com/wavesplatform/gowaves/pkg/services"
"github.com/wavesplatform/gowaves/pkg/state"
)

const apiKey = "X-API-Key"
Expand Down Expand Up @@ -83,8 +82,7 @@ func TestNodeApi_WavesRegularBalanceByAddress(t *testing.T) {
addr, err := proto.NewAddressFromString(addrStr)
require.NoError(t, err)

ctrl := gomock.NewController(t)
st := mock.NewMockState(ctrl)
st := state.NewMockState(t)
st.EXPECT().WavesBalance(proto.NewRecipientFromAddress(addr)).Return(uint64(1000), nil).Times(1)

resp := httptest.NewRecorder()
Expand Down Expand Up @@ -112,13 +110,11 @@ func TestNodeApi_WavesRegularBalanceByAddress(t *testing.T) {

t.Run("error", func(t *testing.T) {
doTest := func(t *testing.T, addrStr string) {
ctrl := gomock.NewController(t)

resp := httptest.NewRecorder()
req := createRequest(addrStr)

a, err := NewApp("", nil, services.Services{
State: mock.NewMockState(ctrl),
State: state.NewMockState(t),
Scheme: proto.TestNetScheme,
})
require.NoError(t, err)
Expand Down
22 changes: 5 additions & 17 deletions pkg/api/peers_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,16 @@ import (
"time"

"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"

"github.com/wavesplatform/gowaves/pkg/node/peers"
"github.com/wavesplatform/gowaves/pkg/node/peers/storage"
"github.com/wavesplatform/gowaves/pkg/proto"

"github.com/golang/mock/gomock"
"github.com/stretchr/testify/require"

"github.com/wavesplatform/gowaves/pkg/mock"
"github.com/wavesplatform/gowaves/pkg/services"
)

func TestApp_PeersKnown(t *testing.T) {
ctrl := gomock.NewController(t)
defer ctrl.Finish()

peerManager := mock.NewMockPeerManager(ctrl)
peerManager := peers.NewMockPeerManager(t)
addr := proto.NewTCPAddr(net.ParseIP("127.0.0.1"), 6868).ToIpPort()
peerManager.EXPECT().KnownPeers().Return([]storage.KnownPeer{storage.KnownPeer(addr)})

Expand All @@ -34,10 +28,7 @@ func TestApp_PeersKnown(t *testing.T) {
}

func TestApp_PeersSuspended(t *testing.T) {
ctrl := gomock.NewController(t)
defer ctrl.Finish()

peerManager := mock.NewMockPeerManager(ctrl)
peerManager := peers.NewMockPeerManager(t)

now := time.Now()

Expand Down Expand Up @@ -76,10 +67,7 @@ func TestApp_PeersSuspended(t *testing.T) {
}

func TestApp_PeersBlackList(t *testing.T) {
ctrl := gomock.NewController(t)
defer ctrl.Finish()

peerManager := mock.NewMockPeerManager(ctrl)
peerManager := peers.NewMockPeerManager(t)

now := time.Now()

Expand Down
1 change: 0 additions & 1 deletion pkg/consensus/blocks_validation.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ func isInvalidMainNetBlock(blockID proto.BlockID, height uint64) bool {
return false
}

//go:generate moq -out validator_moq_test.go . stateInfoProvider
type stateInfoProvider interface {
HeaderByHeight(height uint64) (*proto.BlockHeader, error)
NewestHitSourceAtHeight(height uint64) ([]byte, error)
Expand Down
33 changes: 18 additions & 15 deletions pkg/consensus/blocks_validation_internal_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"time"

"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/mock"
"github.com/stretchr/testify/require"

"github.com/wavesplatform/gowaves/pkg/crypto"
Expand Down Expand Up @@ -56,20 +57,21 @@ func TestValidator_ShouldIncludeNewBlockFieldsOfLightNodeFeature(t *testing.T) {
}
for i, tt := range tests {
t.Run(strconv.Itoa(i+1), func(t *testing.T) {
sip := &stateInfoProviderMock{
NewestIsActiveAtHeightFunc: func(featureID int16, height uint64) (bool, error) {
m := NewMockstateInfoProvider(t)
m.EXPECT().NewestIsActiveAtHeight(mock.Anything, mock.Anything).RunAndReturn(
func(featureID int16, height uint64) (bool, error) {
require.Equal(t, int16(settings.LightNode), featureID)
require.Equal(t, tt.blockHeight, height)
return tt.lightNodeIsActiveAtHeight, nil
},
NewestActivationHeightFunc: func(featureID int16) (uint64, error) {
}).Maybe()
m.EXPECT().NewestActivationHeight(mock.Anything).RunAndReturn(
func(featureID int16) (uint64, error) {
require.Equal(t, int16(settings.LightNode), featureID)
return tt.lightNodeActivationHeight, nil
},
}
sets := settings.MustTestNetSettings() // copy of testnet settings
}).Maybe()
sets := settings.MustTestNetSettings() // copy of Testnet settings
sets.LightNodeBlockFieldsAbsenceInterval = tt.lightNodeBlockFieldsAbsenceInterval
v := NewValidator(sip, sets, timeMock{})
v := NewValidator(m, sets, timeMock{})
result, err := v.ShouldIncludeNewBlockFieldsOfLightNodeFeature(tt.blockHeight)
require.NoError(t, err)
assert.Equal(t, tt.expectedResult, result)
Expand Down Expand Up @@ -165,18 +167,19 @@ func TestValidator_validateLightNodeBlockFields(t *testing.T) {
}
for i, tt := range tests {
t.Run(strconv.Itoa(i+1), func(t *testing.T) {
sip := &stateInfoProviderMock{
NewestIsActiveAtHeightFunc: func(featureID int16, height uint64) (bool, error) {
sip := NewMockstateInfoProvider(t)
sip.EXPECT().NewestIsActiveAtHeight(mock.Anything, mock.Anything).RunAndReturn(
func(featureID int16, height uint64) (bool, error) {
require.Equal(t, int16(settings.LightNode), featureID)
require.Equal(t, tt.blockHeight, height)
return tt.lightNodeIsActiveAtHeight, nil
},
NewestActivationHeightFunc: func(featureID int16) (uint64, error) {
}).Maybe()
sip.EXPECT().NewestActivationHeight(mock.Anything).RunAndReturn(
func(featureID int16) (uint64, error) {
require.Equal(t, int16(settings.LightNode), featureID)
return tt.lightNodeActivationHeight, nil
},
}
sets := settings.MustTestNetSettings() // copy of testnet settings
}).Maybe()
sets := settings.MustTestNetSettings() // copy of Testnet settings
sets.LightNodeBlockFieldsAbsenceInterval = tt.lightNodeBlockFieldsAbsenceInterval
v := NewValidator(sip, sets, timeMock{})
err := v.validateLightNodeBlockFields(&tt.blockHeader, tt.blockHeight)
Expand Down
Loading
Loading