Skip to content

Commit

Permalink
fix: change checkSpendingCondition according to leapdao/leap-node#242
Browse files Browse the repository at this point in the history
  • Loading branch information
troggy committed Jun 14, 2019
1 parent 7cf9591 commit 741db7f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion tests/0_spendingCondition.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ module.exports = async function(contracts, nodes, accounts, web3) {
const bobPriv = accounts[1].privKey;
const spCode = '0x608060405234801561001057600080fd5b506004361061002e5760e060020a6000350463d01a81e18114610033575b600080fd5b61005f6004803603604081101561004957600080fd5b50600160a060020a038135169060200135610061565b005b6040805160e060020a6370a08231028152306004820152905173111111111111111111111111111111111111111191600091849184916370a0823191602480820192602092909190829003018186803b1580156100bd57600080fd5b505afa1580156100d1573d6000803e3d6000fd5b505050506040513d60208110156100e757600080fd5b50516040805160e060020a63a9059cbb028152600160a060020a03888116600483015260248201889052915193909203935084169163a9059cbb916044808201926020929091908290030181600087803b15801561014457600080fd5b505af1158015610158573d6000803e3d6000fd5b505050506040513d602081101561016e57600080fd5b505060008111156101f8576040805160e060020a63a9059cbb028152306004820152602481018390529051600160a060020a0384169163a9059cbb9160448083019260209291908290030181600087803b1580156101cb57600080fd5b505af11580156101df573d6000803e3d6000fd5b505050506040513d60208110156101f557600080fd5b50505b5050505056fea165627a7a72305820b6375cb3c7f659844afea0adf999ea78d73fd047f5823fbe1447f8051fe0189b0029'.replace('1111111111111111111111111111111111111111', contracts.token.options.address.replace('0x', '').toLowerCase());
const codeBuf = Buffer.from(spCode.replace('0x', ''), 'hex');
const spAddrBuf = ethUtil.ripemd160(codeBuf);
const spAddrBuf = ethUtil.ripemd160(codeBuf.length, ethUtil.keccak256(codeBuf));
const spAddr = `0x${spAddrBuf.toString('hex')}`;

console.log("╔══════════════════════════════════════════╗");
Expand Down
2 changes: 1 addition & 1 deletion tests/8_breeding.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ module.exports = async function(contracts, [node], accounts, web3) {
assert.equal(unspents[0].output.data, tokenData, 'tokenData should match');

const script = Buffer.from(BreedingCondition, 'hex');
const scriptHash = ethUtil.ripemd160(script);
const scriptHash = ethUtil.ripemd160(script.length, ethUtil.keccak256(script));
const spAddr = `0x${scriptHash.toString('hex')}`;
// XXX: add support for approval in ERC1949
let transferTx = Tx.transfer(
Expand Down

0 comments on commit 741db7f

Please sign in to comment.