Skip to content

Commit

Permalink
added test case
Browse files Browse the repository at this point in the history
Signed-off-by: Jürgen Eckel <juergen@riddleandcode.com>
  • Loading branch information
eckelj committed May 23, 2024
1 parent 0316eb2 commit 1f43644
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions service/planetmint_client_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
package service_test

import (
"log"
"testing"

"github.com/cosmos/cosmos-sdk/codec"
"github.com/rddl-network/ta_attest/config"
"github.com/rddl-network/ta_attest/service"
"github.com/stretchr/testify/assert"
"google.golang.org/grpc"
"google.golang.org/grpc/credentials/insecure"
)

func TestPlanetmintQueryAccount(t *testing.T) {
cfg := config.DefaultConfig()
grpcConn, err := grpc.Dial(
cfg.PlanetmintRPCHost,
grpc.WithTransportCredentials(insecure.NewCredentials()),
grpc.WithDefaultCallOptions(grpc.ForceCodec(codec.NewProtoCodec(nil).GRPCCodec())),
)
if err != nil {
log.Fatalf("fatal error opening grpc connection %s", err)
}
cfg.PlanetmintActor = "plmnt1rmgh77rsnfz2vk2tn3j0uqczw97znpy0lxp4sm"
pmc := service.NewPlanetmintClient(cfg.PlanetmintActor, grpcConn)
res, err := pmc.GetAccount("plmnt199zf0vkmehhr2hhdt3e425r5dx4749dmenm35w")
assert.NoError(t, err)
assert.NotNil(t, res)

}

Check failure on line 31 in service/planetmint_client_test.go

View workflow job for this annotation

GitHub Actions / audit / audit (1.21)

unnecessary trailing newline (whitespace)

0 comments on commit 1f43644

Please sign in to comment.