Skip to content

Commit

Permalink
fix bridge test
Browse files Browse the repository at this point in the history
  • Loading branch information
lumtis committed Apr 10, 2024
1 parent fab7dce commit 3060eb3
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
4 changes: 2 additions & 2 deletions zetaclient/zetabridge/query_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -768,7 +768,7 @@ func TestZetaCoreBridge_GetBlockHeaderChainState(t *testing.T) {
}}
input := lightclienttypes.QueryGetChainStateRequest{ChainId: chainID}
method := "/zetachain.zetacore.lightclient.Query/ChainState"
server := setupMockServer(t, observertypes.RegisterQueryServer, method, input, expectedOutput)
server := setupMockServer(t, lightclienttypes.RegisterQueryServer, method, input, expectedOutput)
server.Serve()
defer closeMockServer(t, server)

Expand Down Expand Up @@ -846,7 +846,7 @@ func TestZetaCoreBridge_Prove(t *testing.T) {
TxIndex: int64(txIndex),
}
method := "/zetachain.zetacore.lightclient.Query/Prove"
server := setupMockServer(t, observertypes.RegisterQueryServer, method, input, expectedOutput)
server := setupMockServer(t, lightclienttypes.RegisterQueryServer, method, input, expectedOutput)
server.Serve()
defer closeMockServer(t, server)

Expand Down
11 changes: 11 additions & 0 deletions zetaclient/zetabridge/tx_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import (
"github.com/zeta-chain/zetacore/pkg/coin"
"github.com/zeta-chain/zetacore/pkg/proofs"
crosschaintypes "github.com/zeta-chain/zetacore/x/crosschain/types"
lightclienttypes "github.com/zeta-chain/zetacore/x/lightclient/types"
observertypes "github.com/zeta-chain/zetacore/x/observer/types"
"github.com/zeta-chain/zetacore/zetaclient/authz"
"github.com/zeta-chain/zetacore/zetaclient/config"
Expand Down Expand Up @@ -204,6 +205,7 @@ func TestZetaCoreBridge_UpdateZetaCoreContext(t *testing.T) {
grpcmock.RegisterService(crosschaintypes.RegisterQueryServer),
grpcmock.RegisterService(upgradetypes.RegisterQueryServer),
grpcmock.RegisterService(observertypes.RegisterQueryServer),
grpcmock.RegisterService(lightclienttypes.RegisterQueryServer),
grpcmock.WithPlanner(planner.FirstMatch()),
grpcmock.WithListener(listener),
func(s *grpcmock.Server) {
Expand Down Expand Up @@ -286,6 +288,15 @@ func TestZetaCoreBridge_UpdateZetaCoreContext(t *testing.T) {
GasPriceIncreaseFlags: nil,
BlockHeaderVerificationFlags: nil,
}})

method = "/zetachain.zetacore.lightclient.Query/VerificationFlags"
s.ExpectUnary(method).
UnlimitedTimes().
WithPayload(lightclienttypes.QueryVerificationFlagsRequest{}).
Return(lightclienttypes.QueryVerificationFlagsResponse{VerificationFlags: lightclienttypes.VerificationFlags{
EthTypeChainEnabled: true,
BtcTypeChainEnabled: false,
}})
},
)(t)

Expand Down

0 comments on commit 3060eb3

Please sign in to comment.