aptos-core icon indicating copy to clipboard operation
aptos-core copied to clipboard

[API] Restructure Transaction response so common fields are always available

Open banool opened this issue 2 years ago • 1 comments

Currently Transaction is a union of different variants of transactions. We know however that all of these variants have some common fields, e.g. success in some cases, for example when reading an on-chain transaction (though in this case, we'd need two enums, one with PendingTransaction and one without). We should restructure the code such that there is a top level struct with these common fields, and then have the dissimilar variants be a field within that top level struct. That way you don't have to do something like this:

(transaction as any).success

But can instead just do this:

transaction.success

banool avatar Aug 08 '22 19:08 banool

@banool Is this issue available to work on?

Nike682631 avatar Aug 13 '22 18:08 Nike682631

This issue is stale because it has been open 45 days with no activity. Remove the stale label or comment - otherwise this will be closed in 15 days.

github-actions[bot] avatar Dec 20 '22 01:12 github-actions[bot]