Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove deprecated getLedgerEntry endpoint #276

Merged
merged 2 commits into from
Sep 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

## Unreleased

### Breaking Change
- Remove `GetLedgerEntry` endpoint. This endpoint was already deprecated earlier in favor of `GetLedgerEntries` and is completely removed in this release.

### Added

- Add `EndLedger` in `GetEventsRequest`. This provides finer control and clarity on the range of ledgers being queried.
Expand Down
84 changes: 0 additions & 84 deletions cmd/soroban-rpc/internal/integrationtest/get_ledger_entry_test.go

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -377,20 +377,21 @@ func TestSimulateTransactionExtendAndRestoreFootprint(t *testing.T) {

keyB64, err := xdr.MarshalBase64(key)
require.NoError(t, err)
getLedgerEntryrequest := methods.GetLedgerEntryRequest{
Key: keyB64,
getLedgerEntriesRequest := methods.GetLedgerEntriesRequest{
Keys: []string{keyB64},
}
var getLedgerEntryResult methods.GetLedgerEntryResponse
var getLedgerEntriesResult methods.GetLedgerEntriesResponse
client := test.GetRPCLient()
err = client.CallResult(context.Background(), "getLedgerEntry", getLedgerEntryrequest, &getLedgerEntryResult)
err = client.CallResult(context.Background(), "getLedgerEntries", getLedgerEntriesRequest, &getLedgerEntriesResult)
require.NoError(t, err)

var entry xdr.LedgerEntryData
require.NoError(t, xdr.SafeUnmarshalBase64(getLedgerEntryResult.EntryXDR, &entry))
ledgerEntry := getLedgerEntriesResult.Entries[0]
require.NoError(t, xdr.SafeUnmarshalBase64(ledgerEntry.DataXDR, &entry))
require.Equal(t, xdr.LedgerEntryTypeContractData, entry.Type)
require.NotNil(t, getLedgerEntryResult.LiveUntilLedgerSeq)
require.NotNil(t, ledgerEntry.LiveUntilLedgerSeq)

initialLiveUntil := *getLedgerEntryResult.LiveUntilLedgerSeq
initialLiveUntil := *ledgerEntry.LiveUntilLedgerSeq

// Extend the initial TTL
test.PreflightAndSendMasterOperation(&txnbuild.ExtendFootprintTtl{
Expand All @@ -408,12 +409,14 @@ func TestSimulateTransactionExtendAndRestoreFootprint(t *testing.T) {
},
)

err = client.CallResult(context.Background(), "getLedgerEntry", getLedgerEntryrequest, &getLedgerEntryResult)
err = client.CallResult(context.Background(), "getLedgerEntries", getLedgerEntriesRequest, &getLedgerEntriesResult)
require.NoError(t, err)
require.NoError(t, xdr.SafeUnmarshalBase64(getLedgerEntryResult.EntryXDR, &entry))

ledgerEntry = getLedgerEntriesResult.Entries[0]
require.NoError(t, xdr.SafeUnmarshalBase64(ledgerEntry.DataXDR, &entry))
require.Equal(t, xdr.LedgerEntryTypeContractData, entry.Type)
require.NotNil(t, getLedgerEntryResult.LiveUntilLedgerSeq)
newLiveUntilSeq := *getLedgerEntryResult.LiveUntilLedgerSeq
require.NotNil(t, ledgerEntry.LiveUntilLedgerSeq)
newLiveUntilSeq := *ledgerEntry.LiveUntilLedgerSeq
require.Greater(t, newLiveUntilSeq, initialLiveUntil)

// Wait until it is not live anymore
Expand Down
7 changes: 0 additions & 7 deletions cmd/soroban-rpc/internal/jsonrpc.go
Original file line number Diff line number Diff line change
Expand Up @@ -199,13 +199,6 @@ func NewJSONRPCHandler(cfg *config.Config, params HandlerParams) Handler {
queueLimit: cfg.RequestBacklogGetLatestLedgerQueueLimit,
requestDurationLimit: cfg.MaxGetLatestLedgerExecutionDuration,
},
{
methodName: "getLedgerEntry",
underlyingHandler: methods.NewGetLedgerEntryHandler(params.Logger, params.LedgerEntryReader),
longName: "get_ledger_entry",
queueLimit: cfg.RequestBacklogGetLedgerEntriesQueueLimit, // share with getLedgerEntries
requestDurationLimit: cfg.MaxGetLedgerEntriesExecutionDuration,
},
{
methodName: "getLedgerEntries",
underlyingHandler: methods.NewGetLedgerEntriesHandler(params.Logger, params.LedgerEntryReader),
Expand Down
131 changes: 0 additions & 131 deletions cmd/soroban-rpc/internal/methods/get_ledger_entry.go

This file was deleted.

Loading