query machine in test

Signed-off-by: Lorenz Herzberger <lorenzherzberger@gmail.com>
This commit is contained in:
Lorenz Herzberger 2023-07-12 13:30:58 +02:00
parent ee4f2bfda0
commit 24511388d2
No known key found for this signature in database
GPG Key ID: FA5EE906EB55316A
2 changed files with 15 additions and 2 deletions

View File

@ -2,6 +2,7 @@ package machine
import (
"fmt"
"net/url"
"planetmint-go/testutil"
machinetypes "planetmint-go/x/machine/types"
@ -119,6 +120,16 @@ func (s *E2ETestSuite) TestAttestMachineREST() {
s.T().Log("RESULT:")
s.T().Log(string(r))
s.T().Log(string(pubKey))
urlPubKey := url.QueryEscape(pubKey)
s.T().Log(string(urlPubKey))
queryMachineUrl := fmt.Sprintf("%s/planetmint-go/machine/get_machine_by_public_key/%s", baseURL, urlPubKey)
s.T().Log(string(queryMachineUrl))
queryMachineRes, err := testutil.GetRequest(queryMachineUrl)
s.Require().NoError(err)
s.T().Log(string(queryMachineRes))
// Encode TX
reqEncodeTx := fmt.Sprintf("%s/cosmos/tx/v1beta1/encode", baseURL)

View File

@ -19,8 +19,10 @@ import (
)
// Queryable pubkey for TestAttestMachine
const pubKey = "A/ZrbETECRq5DNGJZ0aH0DjlV4Y1opMlRfGoEJH454eB"
const mnemonic = "science humor project sword foil amazing exhibit afford kangaroo child pulse adapt camera trigger isolate pull approve october dragon critic vendor panic business valve"
// const pubKey = "A/ZrbETECRq5DNGJZ0aH0DjlV4Y1opMlRfGoEJH454eB"
// const mnemonic = "science humor project sword foil amazing exhibit afford kangaroo child pulse adapt camera trigger isolate pull approve october dragon critic vendor panic business valve"
const pubKey = "AjKN6HiWucu1EBwzX0ACnkvomJiLRwq79oPxoLMY1zRw"
const mnemonic = "helmet hedgehog lab actor weekend elbow pelican valid obtain hungry rocket decade tower gallery fit practice cart cherry giggle hair snack glance bulb farm"
// Struct definition of machine E2ETestSuite
type E2ETestSuite struct {