From 4382dc3d2e5b32342495629e5ed8b1c328670c99 Mon Sep 17 00:00:00 2001 From: Anton Bukov Date: Sun, 7 May 2023 01:16:46 +0300 Subject: [PATCH] Simplify type(S).typehash tests --- .../smtCheckerTests/types/type_typehash.sol | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/test/libsolidity/smtCheckerTests/types/type_typehash.sol b/test/libsolidity/smtCheckerTests/types/type_typehash.sol index 5d07027ba..50ac3ccfe 100644 --- a/test/libsolidity/smtCheckerTests/types/type_typehash.sol +++ b/test/libsolidity/smtCheckerTests/types/type_typehash.sol @@ -30,18 +30,18 @@ contract C { } function f() public pure { - assert(type(S1).typehash == keccak256(bytes("S1(uint256 x)"))); - assert(type(S2).typehash == keccak256(bytes("S2(uint256 x,address y)"))); - assert(type(S3).typehash == keccak256(bytes("S3(uint256 x,address y,S2 third)S2(uint256 x,address y)"))); - assert(type(S4).typehash == keccak256(bytes("S4(S3 one,S2 two)S2(uint256 x,address y)S3(uint256 x,address y,S2 third)"))); - assert(type(S5).typehash == keccak256(bytes("S5(S2 two,S1 one,S3 three,S4[5] four)S1(uint256 x)S2(uint256 x,address y)S3(uint256 x,address y,S2 third)S4(S3 one,S2 two)"))); + assert(type(S1).typehash == keccak256("S1(uint256 x)")); + assert(type(S2).typehash == keccak256("S2(uint256 x,address y)")); + assert(type(S3).typehash == keccak256("S3(uint256 x,address y,S2 third)S2(uint256 x,address y)")); + assert(type(S4).typehash == keccak256("S4(S3 one,S2 two)S2(uint256 x,address y)S3(uint256 x,address y,S2 third)")); + assert(type(S5).typehash == keccak256("S5(S2 two,S1 one,S3 three,S4[5] four)S1(uint256 x)S2(uint256 x,address y)S3(uint256 x,address y,S2 third)S4(S3 one,S2 two)")); } } // ==== // SMTEngine: all // ---- -// Warning 6328: (386-448): CHC: Assertion violation happens here. -// Warning 6328: (452-524): CHC: Assertion violation happens here. -// Warning 6328: (528-632): CHC: Assertion violation happens here. -// Warning 6328: (642-763): CHC: Assertion violation happens here. -// Warning 6328: (773-944): CHC: Assertion violation happens here. +// Warning 6328: (386-441): CHC: Assertion violation happens here. +// Warning 6328: (445-510): CHC: Assertion violation happens here. +// Warning 6328: (514-611): CHC: Assertion violation happens here. +// Warning 6328: (621-735): CHC: Assertion violation happens here. +// Warning 6328: (745-909): CHC: Assertion violation happens here.