-
Notifications
You must be signed in to change notification settings - Fork 335
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Blake2 precompile to runtimes (#935)
* Add Blake2 precompile to runtimes * Add Blake2 address to 'used_addresses' * Add test case for Blake2 precompile
- Loading branch information
Showing
10 changed files
with
13,590 additions
and
6 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import { expect } from "chai"; | ||
import { describeDevMoonbeam } from "../util/setup-dev-tests"; | ||
import { createContract } from "../util/transactions"; | ||
|
||
describeDevMoonbeam("Precompiles - Blake2", (context) => { | ||
it("should be accessible from a smart contract", async function () { | ||
const { contract, rawTx } = await createContract(context.web3, "Blake2Check"); | ||
const { txResults } = await context.createBlock({ transactions: [rawTx] }); | ||
|
||
// The contract should deploy successfully and the receipt should show success. | ||
const receipt = await context.web3.eth.getTransactionReceipt(txResults[0].result); | ||
expect(receipt.status).to.be.true; | ||
|
||
// invoke the contract's test function 'callF' | ||
const result = await contract.methods.callF().call(); | ||
expect(result).to.have.members([ | ||
"0xba80a53f981c4d0d6a2797b69f12f6e94c212f14685ac4b74b12bb6fdbffa2d1", | ||
"0x7d87c5392aab792dc252d5de4533cc9518d38aa8dbf1925ab92386edd4009923", | ||
]); | ||
}); | ||
}); |