Kaynağa Gözat

ethereum: tighten up some test funcs to pure/view

Fallout from #2956
Jeff Schroeder 2 yıl önce
ebeveyn
işleme
049ca971df

+ 1 - 1
ethereum/forge-test/MessagesRV.t.sol

@@ -33,7 +33,7 @@ contract TestMessagesRV is TestUtils {
     }
 
     function generateGuardianSet(GuardianSetParams memory params)
-        internal
+        internal pure
         returns (Structs.GuardianSet memory)
     {
         for (uint8 i = 0; i < params.guardianCount; ++i)

+ 1 - 1
ethereum/forge-test/TokenImplementation.t.sol

@@ -78,7 +78,7 @@ contract TestTokenImplementation is TokenImplementation, Test {
         address spender,
         uint256 amount,
         uint256 deadline
-    ) public returns (SignatureSetup memory output) {
+    ) public view returns (SignatureSetup memory output) {
         // prepare signer allowing for tokens to be spent
         uint256 sk = uint256(walletPrivateKey);
         output.allower = vm.addr(sk);

+ 2 - 2
ethereum/forge-test/rv-helpers/TestUtils.sol

@@ -154,7 +154,7 @@ contract TestUtils is Test, KEVMCheats {
         uint8 consistencyLevel,
         bytes memory payload,
         uint256 pk)
-        internal
+        internal pure
             returns (bytes memory _vm, bytes32 hash)
     {
         bytes memory header = validVmHeader(guardianSetIndex);
@@ -176,7 +176,7 @@ contract TestUtils is Test, KEVMCheats {
         _vm = bytes.concat(header, signature, body);
     }
 
-    function validSignature(uint256 pk, bytes32 hash) public returns (bytes memory signature) {
+    function validSignature(uint256 pk, bytes32 hash) public pure returns (bytes memory signature) {
         uint8 v;
         bytes32 r;
         bytes32 s;