Skip to content

Commit da4232f

Browse files
Fix mock
1 parent 2db1d31 commit da4232f

File tree

1 file changed

+2
-29
lines changed

1 file changed

+2
-29
lines changed

pkg/testutil/lumera.go

Lines changed: 2 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ package testutil
22

33
import (
44
"context"
5-
"strconv"
65

76
"github.com/LumeraProtocol/lumera/x/action/types"
87
supernodeTypes "github.com/LumeraProtocol/lumera/x/supernode/types"
@@ -135,29 +134,7 @@ type MockSupernodeModule struct {
135134
}
136135

137136
func (m *MockSupernodeModule) GetTopSuperNodesForBlock(ctx context.Context, blockHeight uint64) (*supernodeTypes.QueryGetTopSuperNodesForBlockResponse, error) {
138-
// Create supernodes with the actual node addresses supplied in the test
139-
supernodes := make([]*supernodeTypes.SuperNode, 0, len(m.addresses))
140-
141-
for i, addr := range m.addresses {
142-
if i >= 2 { // Only use first couple for bootstrap
143-
break
144-
}
145-
146-
supernode := &supernodeTypes.SuperNode{
147-
SupernodeAccount: addr, // Use the real account address for testing
148-
PrevIpAddresses: []*supernodeTypes.IPAddressHistory{
149-
{
150-
Address: "127.0.0.1:900" + strconv.Itoa(i),
151-
Height: 10,
152-
},
153-
},
154-
}
155-
supernodes = append(supernodes, supernode)
156-
}
157-
158-
return &supernodeTypes.QueryGetTopSuperNodesForBlockResponse{
159-
Supernodes: supernodes,
160-
}, nil
137+
return &supernodeTypes.QueryGetTopSuperNodesForBlockResponse{}, nil
161138
}
162139

163140
func (m *MockSupernodeModule) GetSuperNode(ctx context.Context, address string) (*supernodeTypes.QueryGetSuperNodeResponse, error) {
@@ -202,11 +179,7 @@ func (m *MockNodeModule) Verify(accAddress string, data []byte, signature []byte
202179

203180
func (m *MockNodeModule) GetLatestBlock(ctx context.Context) (*cmtservice.GetLatestBlockResponse, error) {
204181
return &cmtservice.GetLatestBlockResponse{
205-
SdkBlock: &cmtservice.Block{
206-
Header: cmtservice.Header{
207-
Height: 100,
208-
},
209-
},
182+
SdkBlock: &cmtservice.Block{},
210183
}, nil
211184
}
212185

0 commit comments

Comments
 (0)