[test] Use elements RPC mock server (#232)

Fix `reissueasset` in tests.

Signed-off-by: Julian Strobl <jmastr@mailbox.org>
This commit is contained in:
Julian Strobl
2023-12-13 15:42:09 +01:00
committed by GitHub
parent bb8e055e44
commit ff2f2eb386
3 changed files with 8 additions and 3 deletions

2
go.mod
View File

@@ -21,7 +21,7 @@ require (
github.com/grpc-ecosystem/grpc-gateway v1.16.0
github.com/grpc-ecosystem/grpc-gateway/v2 v2.15.2
github.com/planetmint/planetmint-go/lib v0.2.1
github.com/rddl-network/elements-rpc v0.3.0
github.com/rddl-network/elements-rpc v0.4.0
github.com/spf13/cast v1.5.0
github.com/spf13/cobra v1.6.1
github.com/spf13/pflag v1.0.5

4
go.sum
View File

@@ -889,8 +889,8 @@ github.com/rakyll/statik v0.1.7/go.mod h1:AlZONWzMtEnMs7W4e/1LURLiI49pIMmp6V9Ung
github.com/rcrowley/go-metrics v0.0.0-20181016184325-3113b8401b8a/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4=
github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 h1:N/ElC8H3+5XpJzTSTfLsJV/mx9Q9g7kxmchpfZyxgzM=
github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4=
github.com/rddl-network/elements-rpc v0.3.0 h1:riPjQWy/aUMeDnOPpRgMB8ddCVmvQX7XVWBYCi/BZ5Q=
github.com/rddl-network/elements-rpc v0.3.0/go.mod h1:WOSYDMhq+V74lReSInnSejbdEyGI8hiQZSn4cSoFuxo=
github.com/rddl-network/elements-rpc v0.4.0 h1:A9I8JnbT7hcThGdcHoRZeBg5zMZp2EjDZOIT8EpHFIE=
github.com/rddl-network/elements-rpc v0.4.0/go.mod h1:WOSYDMhq+V74lReSInnSejbdEyGI8hiQZSn4cSoFuxo=
github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg=
github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ=
github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4=

View File

@@ -16,6 +16,8 @@ import (
simtestutil "github.com/cosmos/cosmos-sdk/testutil/sims"
sdk "github.com/cosmos/cosmos-sdk/types"
authtypes "github.com/cosmos/cosmos-sdk/x/auth/types"
elements "github.com/rddl-network/elements-rpc"
"github.com/rddl-network/elements-rpc/utils/mocks"
"github.com/stretchr/testify/require"
"github.com/planetmint/planetmint-go/app"
@@ -43,6 +45,9 @@ func New(t *testing.T, configs ...Config) *Network {
}
validatorTmpDir := t.TempDir()
// use mock client for testing
elements.Client = &mocks.MockClient{}
// enable application logger in tests
appLogger := util.GetAppLogger()
appLogger.SetTestingLogger(t)