diff --git a/src/protocols/JsonRPC.sol b/src/protocols/EthJsonRPC.sol similarity index 98% rename from src/protocols/JsonRPC.sol rename to src/protocols/EthJsonRPC.sol index c19be57..03b70ed 100644 --- a/src/protocols/JsonRPC.sol +++ b/src/protocols/EthJsonRPC.sol @@ -5,7 +5,7 @@ import "src/suavelib/Suave.sol"; import "solady/src/utils/JSONParserLib.sol"; import "solady/src/utils/LibString.sol"; -contract JsonRPC { +contract EthJsonRPC { using JSONParserLib for *; string endpoint; diff --git a/test/protocols/EthJsonRPC.t.sol b/test/protocols/EthJsonRPC.t.sol new file mode 100644 index 0000000..47ff4a8 --- /dev/null +++ b/test/protocols/EthJsonRPC.t.sol @@ -0,0 +1,24 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.13; + +import "forge-std/Test.sol"; +import "src/Test.sol"; +import "solady/src/utils/LibString.sol"; +import "src/protocols/EthJsonRPC.sol"; + +contract EthJsonRPCTest is Test, SuaveEnabled { + function testEthJsonRPCGetNonce() public { + EthJsonRPC ethjsonrpc = getEthJsonRPC(); + + uint256 nonce = ethjsonrpc.nonce(address(this)); + assertEq(nonce, 0); + } + + function getEthJsonRPC() public returns (EthJsonRPC ethjsonrpc) { + try vm.envString("JSONRPC_ENDPOINT") returns (string memory endpoint) { + ethjsonrpc = new EthJsonRPC(endpoint); + } catch { + vm.skip(true); + } + } +} diff --git a/test/protocols/JsonRPC.t.sol b/test/protocols/JsonRPC.t.sol deleted file mode 100644 index ba95638..0000000 --- a/test/protocols/JsonRPC.t.sol +++ /dev/null @@ -1,24 +0,0 @@ -// SPDX-License-Identifier: UNLICENSED -pragma solidity ^0.8.13; - -import "forge-std/Test.sol"; -import "src/Test.sol"; -import "solady/src/utils/LibString.sol"; -import "src/protocols/JsonRPC.sol"; - -contract JsonRPCTest is Test, SuaveEnabled { - function testJsonRPCGetNonce() public { - JsonRPC jsonrpc = getJsonRPC(); - - uint256 nonce = jsonrpc.nonce(address(this)); - assertEq(nonce, 0); - } - - function getJsonRPC() public returns (JsonRPC jsonrpc) { - try vm.envString("JSONRPC_ENDPOINT") returns (string memory endpoint) { - jsonrpc = new JsonRPC(endpoint); - } catch { - vm.skip(true); - } - } -}