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

Allow one to parse the outcome of contract calls which are inner transactions (relayed V3) #495

Closed
wants to merge 41 commits into from

Conversation

andreibancioiu
Copy link
Contributor

@andreibancioiu andreibancioiu commented Oct 4, 2024

@andreibancioiu andreibancioiu self-assigned this Oct 4, 2024
* Generally speaking, useful for Relayed V3 transactions.
*/
public transactionOnNetworkToOutcomesOfInnerTransactions(
transactionOnNetwork: ITransactionOnNetwork,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Since the input is a ITransactionOnNetwork, this works both for the TransactionOnNetwork from the satellite package sdk-network-providers, and for the class within sdk-core/networkProviders (long time support rationale).

* Artificially converts an inner transaction (of a relayed V3) to a transaction on the network,
* by matching the inner transaction with its corresponding smart contract result.
*/
private convertInnerTransactionToTransactionOnNetwork(
Copy link
Contributor Author

Choose a reason for hiding this comment

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

We'll keep this private, since it's a temporary workaround, until proper VM output is returned from the Proxy & API.

@@ -26,6 +26,10 @@ export interface ITransactionOnNetwork {
receipt: ITransactionReceipt;
contractResults: IContractResults;
logs: ITransactionLogs;

// TODO: In a future major release, make these required (empty is allowed).
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Actually, maybe, we'll completely drop these interfaces, and use simple DTOs (according to the specs).

/**
* @deprecated This will be remove with the next release (replaced by the `ITransaction` interface from "src/interface.ts").
*/
export type ITransactionNext = ITransactionAsInSpecs;
Copy link
Contributor Author

@andreibancioiu andreibancioiu Oct 4, 2024

Choose a reason for hiding this comment

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

Previously, ITransactionNext was almost the same as ITransactionAsInSpecs, with the exception of:

  • ITransactionNext.relayer was optional, ITransactionAsInSpecs.relayer isn't (but empty is allowed)
  • ITransactionNext.innerTransactions was optional, ITransactionAsInSpecs.innerTransactions isn't (but empty is allowed).

This should not be considered a breaking change, since it's an alteration of an interface that's merely used as the substitute of Transaction within the network provider components, newly moved to src/networkProviders.

@andreibancioiu
Copy link
Contributor Author

Not needed anymore (relayed V3 will not stay in the current format).

@andreibancioiu andreibancioiu deleted the inner-03 branch October 21, 2024 09:54
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.

1 participant