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

Code enhancements #354

Merged
merged 4 commits into from
Nov 21, 2023
Merged

Conversation

michavie
Copy link
Contributor

  • Added code hash computation
  • Added fromHex
  • Added tests

andreibancioiu
andreibancioiu previously approved these changes Nov 17, 2023
src/smartcontracts/code.ts Outdated Show resolved Hide resolved
src/smartcontracts/code.ts Show resolved Hide resolved
@@ -25,4 +37,12 @@ export class Code {
valueOf(): Buffer {
return Buffer.from(this.hex, "hex");
}

computeHash(): Hash {
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 this can directly be a Buffer. At some point, we might remove the Hash object. E.g. see the sdk-specs for transaction hash: https://github.com/multiversx/mx-sdk-specs/blob/main/sdk-core/transaction.md

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated

popenta
popenta previously approved these changes Nov 17, 2023
@michavie michavie dismissed stale reviews from popenta and andreibancioiu via f4b91cd November 17, 2023 10:22
@andreibancioiu andreibancioiu merged commit a61c968 into multiversx:main Nov 21, 2023
1 check passed
@michavie michavie deleted the code-enhancements branch November 27, 2023 10:10
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