Skip to content

Commit

Permalink
add test
Browse files Browse the repository at this point in the history
  • Loading branch information
Amxx committed Aug 24, 2023
1 parent 6283419 commit 54a1b0d
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 0 deletions.
9 changes: 9 additions & 0 deletions contracts/namespaces.sol
Original file line number Diff line number Diff line change
Expand Up @@ -51,3 +51,12 @@ contract C7 {
uint y;
// a separate comment
}

contract C8 {
address private x;
address private y = address(this);

constructor() {
x = msg.sender;
}
}
27 changes: 27 additions & 0 deletions src/transform-namespaces.test.ts.md
Original file line number Diff line number Diff line change
Expand Up @@ -164,4 +164,31 @@ Generated by [AVA](https://avajs.dev).
}␊
// a separate comment␊
}␊
contract C8 {␊
/// @custom:storage-location erc7201:openzeppelin.storage.C8␊
struct C8Storage {␊
address x;␊
address y;␊
}␊
// keccak256(abi.encode(uint256(keccak256("openzeppelin.storage.C8")) - 1))␊
bytes32 private constant C8StorageLocation = 0xb93ad5010b0e46eab6ce47e44cb42c85a263d4e8daf058e8a66e4f114144f212;␊
function _getC8Storage() private pure returns (C8Storage storage $) {␊
assembly {␊
$.slot := C8StorageLocation␊
}␊
}␊
constructor() {function __C8_init() internal onlyInitializing {␊
__C8_init_unchained();␊
}␊
function __C8_init_unchained() internal onlyInitializing {␊
$.y = address(this);␊
C8Storage storage $ = _getC8Storage();␊
$.x = msg.sender;␊
}␊
}␊
`
Binary file modified src/transform-namespaces.test.ts.snap
Binary file not shown.

0 comments on commit 54a1b0d

Please sign in to comment.