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

Add a more generic getLedgerEntry rpc method #274

Merged
merged 13 commits into from
Dec 2, 2022
Merged

Conversation

paulbellamy
Copy link
Contributor

@paulbellamy paulbellamy commented Nov 30, 2022

What

Add a new rpc getLedgerEntry method to supersede getContractData.

Why

Because the contract storage has changed with the new xdr, getContractData can no longer be used by soroban-cli to fetch the contract code. We could have added the getContractCode endpoint from the original spec. But, it's come up several times that actually getLedgerEntry is both lower-level and more useful.

The plan will be to deprecate getContractData, and remove it in favour of getLedgerEntry in the next release.

Todo

  • Rebase this onto main
  • test this
  • use the new method from soroban-cli to fetch the contract code
    • Will need two requests, one to get the code address, and a second to get the actual code.
  • update the rust dependencies to include the new xdr and conversions
  • update the go dependency to include the new xdr
  • Once merged: Update the api doc

@tomerweller
Copy link

tomerweller commented Nov 30, 2022

Awesome.
I added a warning in the API doc next to getContractData
Is this PR expected to close stellar/go#4695 as well?

@paulbellamy
Copy link
Contributor Author

Yes, that is the issue, thanks.

@2opremio 2opremio mentioned this pull request Dec 1, 2022
10 tasks
Paul Bellamy and others added 2 commits December 2, 2022 19:37
* Updating xdr for soroban-rpc

* Trying the new core version

* Fix nil pointer

* Need to compare contract hash not contract code now

* getLedgerEntry test checks code not hash

* Fixing tests

* update go mod/sum to reflect the latest soroban-xdr-next branch in go monorepo

* Update sdk and env to latest crates

* Fix up conversions and clippy

* Need to use the sandbox passphrase in the sandbox

* update test mocks for new contract ids

* Updating contract ids for e2e

Co-authored-by: tsachiherman <24438559+tsachiherman@users.noreply.github.com>
@paulbellamy
Copy link
Contributor Author

FYI: The e2e test on this will fail until quickstart is updated.

@paulbellamy paulbellamy enabled auto-merge (squash) December 2, 2022 19:48
@sreuland
Copy link
Contributor

sreuland commented Dec 2, 2022

looks good, I didn't dig in too deep on the rust though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants