Skip to content

Commit

Permalink
Adjust existing tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
chriseth committed Oct 15, 2020
1 parent 4aead66 commit 52aab54
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ contract test {
}
// ====
// EVMVersion: >=byzantium
// ABIEncoderV1Only: true
// ----
// library: L
// get(uint8): 0 -> 0
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
pragma experimental ABIEncoderV2;

enum E { A, B, C }
library L {
function get(mapping(E => uint8) storage table, E k) external returns (uint8) {
return table[k];
}
function set(mapping(E => uint8) storage table, E k, uint8 v) external {
table[k] = v;
}
}
contract test {
mapping(E => uint8) table;
function get(E k) public returns (uint8 v) {
return L.get(table, k);
}
function set(E k, uint8 v) public {
L.set(table, k, v);
}
}
// ====
// EVMVersion: >=byzantium
// ----
// library: L
// get(uint8): 0 -> 0
// get(uint8): 0x01 -> 0
// get(uint8): 0xa7 -> FAILURE
// set(uint8,uint8): 0x01, 0xa1 ->
// get(uint8): 0 -> 0
// get(uint8): 0x01 -> 0xa1
// get(uint8): 0xa7 -> FAILURE
// set(uint8,uint8): 0x00, 0xef ->
// get(uint8): 0 -> 0xef
// get(uint8): 0x01 -> 0xa1
// get(uint8): 0xa7 -> FAILURE
// set(uint8,uint8): 0x01, 0x05 ->
// get(uint8): 0 -> 0xef
// get(uint8): 0x01 -> 0x05
// get(uint8): 0xa7 -> FAILURE

0 comments on commit 52aab54

Please sign in to comment.