mirror of
https://github.com/planetmint/planetmint-go.git
synced 2025-11-24 22:45:45 +00:00
fix: shamir mock setup for machine issuance test
Signed-off-by: Lorenz Herzberger <lorenzherzberger@gmail.com>
This commit is contained in:
parent
62fe799eca
commit
c133a1fd79
@ -64,8 +64,8 @@ func Load(t *testing.T, configs ...Config) *Network {
|
|||||||
}, nil)
|
}, nil)
|
||||||
shamirMock.EXPECT().IssueMachineNFT(gomock.Any(), gomock.Any(), gomock.Any(), gomock.Any()).AnyTimes().Return(clients.IssueMachineNFTResponse{
|
shamirMock.EXPECT().IssueMachineNFT(gomock.Any(), gomock.Any(), gomock.Any(), gomock.Any()).AnyTimes().Return(clients.IssueMachineNFTResponse{
|
||||||
HexTX: "0000000000000000000000000000000000000000000000000000000000000000",
|
HexTX: "0000000000000000000000000000000000000000000000000000000000000000",
|
||||||
Contract: "contract",
|
Contract: `{"entity":{"domain":"testnet-assets.rddl.io"}, "issuer_pubkey":"02", "machine_addr":"addr","name":"machine","precicion":8,"version":1}`,
|
||||||
Asset: "7add40beb27df701e02ee85089c5bc0021bc813823fedb5f1dcb5debda7f3da9",
|
Asset: "0000000000000000000000000000000000000000000000000000000000000000",
|
||||||
}, nil)
|
}, nil)
|
||||||
clients.ShamirCoordinatorServiceClient = shamirMock
|
clients.ShamirCoordinatorServiceClient = shamirMock
|
||||||
|
|
||||||
|
|||||||
@ -9,7 +9,10 @@ import (
|
|||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
sdk "github.com/cosmos/cosmos-sdk/types"
|
sdk "github.com/cosmos/cosmos-sdk/types"
|
||||||
|
"github.com/golang/mock/gomock"
|
||||||
|
"github.com/planetmint/planetmint-go/clients"
|
||||||
"github.com/planetmint/planetmint-go/testutil/keeper"
|
"github.com/planetmint/planetmint-go/testutil/keeper"
|
||||||
|
clientmocks "github.com/planetmint/planetmint-go/testutil/mocks"
|
||||||
"github.com/planetmint/planetmint-go/testutil/moduleobject"
|
"github.com/planetmint/planetmint-go/testutil/moduleobject"
|
||||||
"github.com/planetmint/planetmint-go/testutil/sample"
|
"github.com/planetmint/planetmint-go/testutil/sample"
|
||||||
"github.com/planetmint/planetmint-go/util"
|
"github.com/planetmint/planetmint-go/util"
|
||||||
@ -47,7 +50,15 @@ func TestRegisterNFT(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func TestMachineNFTIssuance(t *testing.T) {
|
func TestMachineNFTIssuance(t *testing.T) {
|
||||||
|
ctrl := gomock.NewController(t)
|
||||||
elements.Client = &elementsmocks.MockClient{}
|
elements.Client = &elementsmocks.MockClient{}
|
||||||
|
shamirMock := clientmocks.NewMockIShamirCoordinatorClient(ctrl)
|
||||||
|
shamirMock.EXPECT().IssueMachineNFT(gomock.Any(), gomock.Any(), gomock.Any(), gomock.Any()).AnyTimes().Return(clients.IssueMachineNFTResponse{
|
||||||
|
HexTX: "0000000000000000000000000000000000000000000000000000000000000000",
|
||||||
|
Contract: `{"entity":{"domain":"testnet-assets.rddl.io"}, "issuer_pubkey":"02", "machine_addr":"addr","name":"machine","precicion":8,"version":1}`,
|
||||||
|
Asset: "0000000000000000000000000000000000000000000000000000000000000000",
|
||||||
|
}, nil)
|
||||||
|
clients.ShamirCoordinatorServiceClient = shamirMock
|
||||||
util.RegisterAssetServiceHTTPClient = &mocks.MockClient{}
|
util.RegisterAssetServiceHTTPClient = &mocks.MockClient{}
|
||||||
_, ctx := keeper.MachineKeeper(t)
|
_, ctx := keeper.MachineKeeper(t)
|
||||||
params := types.DefaultParams()
|
params := types.DefaultParams()
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user