Unverified Commit 6703fcf6 authored by Omkara's avatar Omkara Committed by GitHub

Merge pull request #1089 from ethereum/LianaHus-patch-1

Update tests.sol.js
parents 1e6560e6 55357f18
module.exports = ` module.exports = `
pragma solidity >=0.4.22 <0.6.0;
library Assert { library Assert {
event AssertionEvent( event AssertionEvent(
...@@ -27,13 +29,13 @@ library Assert { ...@@ -27,13 +29,13 @@ library Assert {
} }
// TODO: only for certain versions of solc // TODO: only for certain versions of solc
//function equal(fixed a, fixed b, string memory message) public returns (bool result) { //function equal(fixed a, fixed b, string message) public returns (bool result) {
// result = (a == b); // result = (a == b);
// emit AssertionEvent(result, message); // emit AssertionEvent(result, message);
//} //}
// TODO: only for certain versions of solc // TODO: only for certain versions of solc
//function equal(ufixed a, ufixed b, string memory message) public returns (bool result) { //function equal(ufixed a, ufixed b, string message) public returns (bool result) {
// result = (a == b); // result = (a == b);
// emit AssertionEvent(result, message); // emit AssertionEvent(result, message);
//} //}
...@@ -49,7 +51,7 @@ library Assert { ...@@ -49,7 +51,7 @@ library Assert {
} }
function equal(string memory a, string memory b, string memory message) public returns (bool result) { function equal(string memory a, string memory b, string memory message) public returns (bool result) {
result = (keccak256(abi.encode(a)) == keccak256(abi.encode(b))); result = (keccak256(abi.encodePacked(a)) == keccak256(abi.encodePacked(b)));
emit AssertionEvent(result, message); emit AssertionEvent(result, message);
} }
...@@ -69,13 +71,13 @@ library Assert { ...@@ -69,13 +71,13 @@ library Assert {
} }
// TODO: only for certain versions of solc // TODO: only for certain versions of solc
//function notEqual(fixed a, fixed b, string memory message) public returns (bool result) { //function notEqual(fixed a, fixed b, string message) public returns (bool result) {
// result = (a != b); // result = (a != b);
// emit AssertionEvent(result, message); // emit AssertionEvent(result, message);
//} //}
// TODO: only for certain versions of solc // TODO: only for certain versions of solc
//function notEqual(ufixed a, ufixed b, string memory message) public returns (bool result) { //function notEqual(ufixed a, ufixed b, string message) public returns (bool result) {
// result = (a != b); // result = (a != b);
// emit AssertionEvent(result, message); // emit AssertionEvent(result, message);
//} //}
...@@ -91,7 +93,7 @@ library Assert { ...@@ -91,7 +93,7 @@ library Assert {
} }
function notEqual(string memory a, string memory b, string memory message) public returns (bool result) { function notEqual(string memory a, string memory b, string memory message) public returns (bool result) {
result = (keccak256(abi.encode(a)) != keccak256(abi.encode(b))); result = (keccak256(abi.encodePacked(a)) != keccak256(abi.encodePacked(b)));
emit AssertionEvent(result, message); emit AssertionEvent(result, message);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment