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

Update TransactionOnNetwork to follow specs #555

Merged

Conversation

danielailie
Copy link
Contributor

No description provided.

@danielailie danielailie self-assigned this Dec 19, 2024
result.logs = TransactionLogs.fromHttpResponse(response.logs || {});
// result.raw = response;
Copy link
Contributor

Choose a reason for hiding this comment

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

Commented out?

throw new ErrIsCompletedFieldIsMissingOnTransaction();
}
return transactionOnNetwork.isCompleted;
return transactionOnNetwork.status.isExecuted();
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this correct (execution vs. completion)?

Copy link
Contributor

Choose a reason for hiding this comment

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

Oh, yes, since it's the process status.

andreibancioiu
andreibancioiu previously approved these changes Jan 14, 2025
function: string = "";
data: Buffer = Buffer.from([]);
version: number = 0;
options: number = 0;
signature: string = "";
Copy link
Contributor

Choose a reason for hiding this comment

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

in specs the signature is of type bytes.

Comment on lines +56 to +57
miniblockHash: string = "";
blockHash: string = "";
Copy link
Contributor

Choose a reason for hiding this comment

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

these are also of type bytes in the specs.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

for the extra work to display this in js we will let them string because the hash is usually display

Comment on lines +39 to +50
/**
* Returns whether the transaction has been conpleted (not necessarily with success).
*/
isCompleted(): boolean {
return this.isSuccessful() || this.isFailed() || this.isInvalid();
}

/**
* Returns whether the transaction has been executed successfully.
*/
isSuccessful(): boolean {
return (
this.status == "executed" ||
this.status == "success" ||
this.status == "successful"
);
return this.status == "executed" || this.status == "success" || this.status == "successful";
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe also add the boolean members as well?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

@@ -50,7 +50,7 @@ export class TransactionOnNetwork {
data: Buffer = Buffer.from([]);
version: number = 0;
options: number = 0;
signature: string = "";
signature?: Uint8Array;
Copy link
Contributor

Choose a reason for hiding this comment

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

Should not be optional and you can set the default value to an empty Uint8Array.

@danielailie danielailie merged commit ab2cad2 into feat/next Jan 15, 2025
4 checks passed
@danielailie danielailie deleted the TOOL-410-update-transaction-on-network-to-follow-specs branch January 15, 2025 08:19
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