From 2daaecf442ea601fc79e7f5801d6ec5938015c84 Mon Sep 17 00:00:00 2001 From: Alfonso Acosta Date: Thu, 14 Sep 2023 19:54:45 +0200 Subject: [PATCH] Parse strkey from deployment --- cmd/soroban-rpc/internal/test/cli_test.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/cmd/soroban-rpc/internal/test/cli_test.go b/cmd/soroban-rpc/internal/test/cli_test.go index 6f71c7cf57..e4b5de52a3 100644 --- a/cmd/soroban-rpc/internal/test/cli_test.go +++ b/cmd/soroban-rpc/internal/test/cli_test.go @@ -12,6 +12,7 @@ import ( "github.com/creachadair/jrpc2/jhttp" "github.com/google/shlex" "github.com/stellar/go/keypair" + "github.com/stellar/go/strkey" "github.com/stellar/go/txnbuild" "github.com/stellar/go/xdr" "github.com/stretchr/testify/assert" @@ -75,7 +76,10 @@ func TestCLIRestorePreamble(t *testing.T) { // This ensures that the CLI restores the entry (using the RestorePreamble in the simulateTransaction response) ch := jhttp.NewChannel(test.sorobanRPCURL(), nil) client := jrpc2.NewClient(ch, nil) - contractID := getContractID(t, getCLIDefaultAccount(t), testSalt, StandaloneNetworkPassphrase) + contractIDBytes := strkey.MustDecode(strkey.VersionByteContract, strkeyContractID) + require.Len(t, contractIDBytes, 32) + var contractID [32]byte + copy(contractID[:], contractIDBytes) contractIDHash := xdr.Hash(contractID) counterSym := xdr.ScSymbol("COUNTER") key := xdr.LedgerKey{