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

Soroban Meta Tests #3984

Merged
merged 4 commits into from
Nov 8, 2023
Merged

Conversation

SirTyson
Copy link
Contributor

@SirTyson SirTyson commented Oct 24, 2023

Description

Resolves #3878 and #3859

Overhauls InvokeHostFunctionTests, providing better coverage and more readability. Also adds a test for recording Soroban TX meta. Currently, we test the meta for contract storage, TTL extension, restoration, contract deployment, and failed invocations.

Checklist

  • Reviewed the contributing document
  • Rebased on top of master (no merge commits)
  • Ran clang-format v8.0.0 (via make format or the Visual Studio extension)
  • Compiles
  • Ran all tests
  • If change impacts performance, include supporting evidence per the performance document

Copy link
Contributor

@marta-lokhova marta-lokhova left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A few suggestions. I'm not an expert on invoke host function, so I only did a cursory check there. Could you rebase on top of master please? We'll prioritize merging this change then, to avoid more merge conflicts.

@@ -138,6 +138,10 @@ TransactionFramePtr transactionFromOperations(Application& app,
SequenceNumber seq,
std::vector<Operation> const& ops,
uint32_t fee = 0);
TransactionFramePtr sorobanTransactionFromOperations(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we need this separate function given that we have sorobanTransactionFrameFromOps already? you could update the existing function to generate desired signatures (also, if you don't need to override signatures too often, you could add the override logic directly into the test that needs it, like we do in other tests):

getSignatures(tx).clear();

SorobanResources const& resources, uint32_t inclusionFee,
uint32_t resourceFee, std::optional<std::string> memo)
{
loadSequenceNumber();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe with the latest changes to sorobanTransactionFrameFromOps, we don't need to do this anymore, since you can now pass expected seqnum directly

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(though you'd need to rebase/resolve merge conflicts)

@sisuresh
Copy link
Contributor

sisuresh commented Nov 8, 2023

r+ 401383fc4d663be90fc8f21964c54072c2001c3f

@sisuresh
Copy link
Contributor

sisuresh commented Nov 8, 2023

r+ b1040ac

@latobarita latobarita merged commit 62bac63 into stellar:master Nov 8, 2023
10 checks passed
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.

InvokeHostFunctionTests doesn't record or check meta
4 participants