Skip to content

Commit

Permalink
Merge branch 'renovate/smart-contracts' of github.com:unlock-protocol…
Browse files Browse the repository at this point in the history
…/unlock into renovate/smart-contracts
  • Loading branch information
julien51 committed May 27, 2021
2 parents f37415c + 9648605 commit f4e8498
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions smart-contract-extensions/test/hooks/codeRequiredHook.js
Expand Up @@ -93,11 +93,13 @@ contract('CodeRequiredHook', (accounts) => {
it('can not buy with an incorrect code provided', async () => {
// Calculate an incorrect code
const code = 'WRONG'
const codePK = web3.eth.abi.encodeParameters(
['address', 'bytes32'],
// By including the lock address in the codePK, we can have
// codes reused for multiple locks without that being visible on-chain
[lock.address, web3.utils.keccak256(code)]
const codePK = web3.eth.accounts.hashMessage(
web3.eth.abi.encodeParameters(
['address', 'bytes32'],
// By including the lock address in the codePK, we can have
// codes reused for multiple locks without that being visible on-chain
[lock.address, web3.utils.keccak256(code)]
)
)
const wrongcodeAccount = web3.eth.accounts.privateKeyToAccount(codePK)
const messageToSign = web3.utils.keccak256(
Expand Down

0 comments on commit f4e8498

Please sign in to comment.