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

SmartContractTransactionsOutcomeParser - parseDeploy() #424

Merged
merged 9 commits into from
Mar 29, 2024

Conversation

andreibancioiu
Copy link
Contributor

@andreibancioiu andreibancioiu commented Mar 28, 2024

@andreibancioiu andreibancioiu self-assigned this Mar 28, 2024
@@ -117,7 +117,7 @@ export class TransactionsConverter {
// Before Sirius, there was no "additionalData" field on transaction logs.
// After Sirius, the "additionalData" field includes the payload of the legacy "data" field, as well (as its first element):
// https://github.com/multiversx/mx-chain-go/blob/v1.6.18/process/transactionLog/process.go#L159
const legacyData = eventOnNetwork.dataPayload?.valueOf() || Buffer.from([]);
const legacyData = eventOnNetwork.dataPayload?.valueOf() || Buffer.from(eventOnNetwork.data || "");
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Better handling of legacy data.

@andreibancioiu andreibancioiu marked this pull request as ready for review March 28, 2024 14:01
@@ -32,15 +32,15 @@ export class Address {
/**
* Creates an address object, given a raw string (whether a hex pubkey or a Bech32 address), a sequence of bytes, or another Address object.
*/
public constructor(value: Address | Buffer | string) {
public constructor(value: Address | Buffer | Uint8Array | string) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Small preparation for future updates.

}

return events;
return findEventsByPredicate(transactionOutcome, (event) => event.identifier == identifier);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Arbitrary constraint about any / no found events was dropped (not useful).

@popenta popenta self-requested a review March 28, 2024 14:11
@bogdan-rosianu bogdan-rosianu self-requested a review March 29, 2024 08:39
@andreibancioiu andreibancioiu merged commit 900a8b8 into feat/next Mar 29, 2024
1 check passed
@andreibancioiu andreibancioiu deleted the parse-deploy branch March 29, 2024 08:59
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