From 6f73d433a5c680686b62c4a61994d49b4a2fbacb Mon Sep 17 00:00:00 2001 From: Willem Wyndham Date: Thu, 12 Oct 2023 15:59:35 -0400 Subject: [PATCH] fix: restore test --- cmd/soroban-rpc/internal/test/cli_test.go | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/cmd/soroban-rpc/internal/test/cli_test.go b/cmd/soroban-rpc/internal/test/cli_test.go index bfad4e499..26928bc06 100644 --- a/cmd/soroban-rpc/internal/test/cli_test.go +++ b/cmd/soroban-rpc/internal/test/cli_test.go @@ -211,23 +211,11 @@ func TestCLIRestore(t *testing.T) { ), ) - newExpirationSeq := getExpirationForLedgerEntry(t, client, getExpirationKey(t, getCounterLedgerKey(parseContractStrKey(t, strkeyContractID)))) + newExpirationSeq := getExpirationForLedgerEntry(t, client, getCounterLedgerKey(parseContractStrKey(t, strkeyContractID))) assert.Greater(t, newExpirationSeq, initialExpirationSeq) assert.Equal(t, fmt.Sprintf("New expiration ledger: %d", newExpirationSeq), restoreOutput) } -func getExpirationKey(t *testing.T, key xdr.LedgerKey) xdr.LedgerKey { - assert.True(t, key.Type == xdr.LedgerEntryTypeContractCode || key.Type == xdr.LedgerEntryTypeContractData) - binKey, err := key.MarshalBinary() - assert.NoError(t, err) - return xdr.LedgerKey{ - Type: xdr.LedgerEntryTypeExpiration, - Expiration: &xdr.LedgerKeyExpiration{ - KeyHash: sha256.Sum256(binKey), - }, - } -} - func parseContractStrKey(t *testing.T, strkeyContractID string) [32]byte { contractIDBytes := strkey.MustDecode(strkey.VersionByteContract, strkeyContractID) var contractID [32]byte