Skip to content

Commit 0357ced

Browse files
committed
Update tests and include new for create/create2 calculation
1 parent 9aa304d commit 0357ced

File tree

14 files changed

+84
-16
lines changed

14 files changed

+84
-16
lines changed

test/libsolidity/semanticTests/events/event_emit_from_other_contract.sol

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,4 @@ contract C {
1919
// gas legacy: 250376
2020
// gas legacyOptimized: 174522
2121
// deposit(bytes32), 18 wei: 0x1234 ->
22-
// ~ emit Deposit(address,bytes32,uint256) from 0xf01f7809444bd9a93a854361c6fae3f23d9e23db: #0x0fdd67305928fcac8d213d1e47bfa6165cd0b87b, #0x1234, 0x00
22+
// ~ emit Deposit(address,bytes32,uint256) from 0x137aa4dfc0911524504fcd4d98501f179bc13b4a: #0xc06afe3a8444fc0004668591e8306bfb9968e79e, #0x1234, 0x00

test/libsolidity/semanticTests/events/event_indexed_function.sol

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@ contract C {
66
}
77
// ----
88
// f() ->
9-
// ~ emit Test(function): #0x0fdd67305928fcac8d213d1e47bfa6165cd0b87b26121ff00000000000000000
9+
// ~ emit Test(function): #0xc06afe3a8444fc0004668591e8306bfb9968e79e26121ff00000000000000000

test/libsolidity/semanticTests/events/event_indexed_function2.sol

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,6 @@ contract C {
1010
}
1111
// ----
1212
// f1() ->
13-
// ~ emit TestA(function): #0x0fdd67305928fcac8d213d1e47bfa6165cd0b87bc27fc3050000000000000000
13+
// ~ emit TestA(function): #0xc06afe3a8444fc0004668591e8306bfb9968e79ec27fc3050000000000000000
1414
// f2(uint256): 1 ->
15-
// ~ emit TestB(function): #0x0fdd67305928fcac8d213d1e47bfa6165cd0b87bbf3724af0000000000000000
15+
// ~ emit TestB(function): #0xc06afe3a8444fc0004668591e8306bfb9968e79ebf3724af0000000000000000

test/libsolidity/semanticTests/functionCall/failed_create.sol

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ contract C {
2020
// gas irOptimized: 184005
2121
// gas legacy: 294335
2222
// gas legacyOptimized: 173427
23-
// f(uint256): 20 -> 1370859564726510389319704988634906228201275401179
23+
// f(uint256): 20 -> 0x137aa4dfc0911524504fcd4d98501f179bc13b4a
2424
// x() -> 1
2525
// f(uint256): 20 -> FAILURE
2626
// x() -> 1
@@ -29,5 +29,5 @@ contract C {
2929
// gas legacy: 483942
3030
// gas legacyOptimized: 302349
3131
// x() -> 1
32-
// stack(uint256): 10 -> 693016686122178122849713379390321835634789309880
32+
// stack(uint256): 10 -> 0x87948bd7ebbe13a00bfd930c93e4828ab18e3908
3333
// x() -> 2

test/libsolidity/semanticTests/functionTypes/address_member.sol

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,4 @@ contract C {
99
// ====
1010
// compileToEwasm: also
1111
// ----
12-
// f() -> 90572315268751552425567948436632610904688605307, 90572315268751552425567948436632610904688605307
12+
// f() -> 0xc06afe3a8444fc0004668591e8306bfb9968e79e, 0xc06afe3a8444fc0004668591e8306bfb9968e79e

test/libsolidity/semanticTests/functionTypes/function_external_delete_storage.sol

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ contract C {
2525
// increment() ->
2626
// y() -> 1
2727
// set() ->
28-
// x() -> 0xfdd67305928fcac8d213d1e47bfa6165cd0b87bd09de08a0000000000000000
28+
// x() -> 0xc06afe3a8444fc0004668591e8306bfb9968e79ed09de08a0000000000000000
2929
// increment() ->
3030
// y() -> 2
3131
// incrementIndirectly() ->

test/libsolidity/semanticTests/inlineAssembly/external_function_pointer_address.sol

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,5 @@ contract C {
1313
}
1414
}
1515
// ----
16-
// testYul() -> 0x0fdd67305928fcac8d213d1e47bfa6165cd0b87b
17-
// testSol() -> 0x0fdd67305928fcac8d213d1e47bfa6165cd0b87b
16+
// testYul() -> 0xc06afe3a8444fc0004668591e8306bfb9968e79e
17+
// testSol() -> 0xc06afe3a8444fc0004668591e8306bfb9968e79e

test/libsolidity/semanticTests/isoltestTesting/balance_other_contract.sol

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,5 +23,5 @@ contract ClientReceipt {
2323
// gas irOptimized: 191881
2424
// gas legacy: 235167
2525
// gas legacyOptimized: 180756
26-
// getAddress() -> 0xf01f7809444bd9a93a854361c6fae3f23d9e23db
27-
// balance: 0xf01f7809444bd9a93a854361c6fae3f23d9e23db -> 500
26+
// getAddress() -> 0x137aa4dfc0911524504fcd4d98501f179bc13b4a
27+
// balance: 0x137aa4dfc0911524504fcd4d98501f179bc13b4a -> 500
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
contract D {
2+
uint public x;
3+
constructor(uint a) {
4+
x = a;
5+
}
6+
}
7+
8+
contract C {
9+
function createDSalted(bytes32 salt, uint arg) public {
10+
address predictedAddress = address(uint160(uint(keccak256(abi.encodePacked(
11+
bytes1(0xff),
12+
address(this),
13+
salt,
14+
keccak256(abi.encodePacked(
15+
type(D).creationCode,
16+
arg
17+
))
18+
)))));
19+
20+
D d = new D{salt: salt}(arg);
21+
require(address(d) == predictedAddress, "Address mismatch.");
22+
}
23+
}
24+
// ====
25+
// EVMVersion: >=constantinople
26+
// compileViaYul: also
27+
// ----
28+
// createDSalted(bytes32,uint256): 42, 64 ->
29+
// gas legacy: 104365

test/libsolidity/semanticTests/tryCatch/create.sol

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,4 +29,4 @@ contract C {
2929
// EVMVersion: >=byzantium
3030
// ----
3131
// f() -> 0, 0, 96, 13, "test message."
32-
// g() -> 0xf01f7809444bd9a93a854361c6fae3f23d9e23db, 0, 96, 7, "success"
32+
// g() -> 0x137aa4dfc0911524504fcd4d98501f179bc13b4a, 0, 96, 7, "success"

0 commit comments

Comments
 (0)