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

Remove TransactionHash and hash and update to use TransactionComputer.computeTransactionHash #566

Merged
merged 2 commits into from
Jan 29, 2025

Conversation

danielailie
Copy link
Contributor

No description provided.

@danielailie danielailie self-assigned this Jan 29, 2025
Comment on lines 194 to 195
const computer = new TransactionComputer();
const hashString = computer.computeTransactionHash(deployTransaction);
Copy link
Contributor

Choose a reason for hiding this comment

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

Needed? We have a hash above. Sorry if mistaken.

transaction.getHash().toString(),
"3579ad09099feb9755c860ddd225251170806d833342e912fccdfe2ed5c3a364",
);
const computer = new TransactionComputer();
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe can hold result of await provider.sendTransaction(transaction); and don't use this computer? (serves as a more real-world example, I think).

Copy link
Contributor

Choose a reason for hiding this comment

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

Below, as well.

popenta
popenta previously approved these changes Jan 29, 2025
"3579ad09099feb9755c860ddd225251170806d833342e912fccdfe2ed5c3a364",
);
const computer = new TransactionComputer();
let hashString = computer.computeTransactionHash(transaction);
Copy link
Contributor

Choose a reason for hiding this comment

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

could've simply been called hash.

const serializer = new ProtoSerializer();
const buffer = serializer.serializeTransaction(transaction);
const hash = createTransactionHasher(TRANSACTION_HASH_LENGTH).update(buffer).digest("hex");

return Buffer.from(hash, "hex");
return Buffer.from(hash, "hex").toString("hex");
Copy link
Contributor

Choose a reason for hiding this comment

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

I think hash is already a hex string so there's no need to convert it again. Right?

@danielailie danielailie merged commit 4555bb0 into feat/next Jan 29, 2025
4 checks passed
@danielailie danielailie deleted the TOOL-448-remove-transaction-hash-and-hash branch January 29, 2025 11:51
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