From 69bff1390ee376a4980c8f7dbd7e723cd82b97b1 Mon Sep 17 00:00:00 2001 From: mattstam Date: Tue, 23 Jul 2024 12:27:56 -0700 Subject: [PATCH] chore: minor consistency fixes --- contracts/lib/sp1-contracts | 2 +- contracts/src/Fibonacci.sol | 16 ++++++++-------- contracts/test/Fibonacci.t.sol | 4 ++-- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/contracts/lib/sp1-contracts b/contracts/lib/sp1-contracts index 8bcd3dc..9dc34e8 160000 --- a/contracts/lib/sp1-contracts +++ b/contracts/lib/sp1-contracts @@ -1 +1 @@ -Subproject commit 8bcd3dcf2527ea0403b4715971140fba2b8d3e9e +Subproject commit 9dc34e8eca42a0678727c3c7b2d86c8300946532 diff --git a/contracts/src/Fibonacci.sol b/contracts/src/Fibonacci.sol index b477a3f..2627674 100644 --- a/contracts/src/Fibonacci.sol +++ b/contracts/src/Fibonacci.sol @@ -16,23 +16,23 @@ contract Fibonacci { address public verifier; /// @notice The verification key for the fibonacci program. - bytes32 public fibonacciProgramVkey; + bytes32 public fibonacciProgramVKey; - constructor(address _verifier, bytes32 _fibonacciProgramVkey) { + constructor(address _verifier, bytes32 _fibonacciProgramVKey) { verifier = _verifier; - fibonacciProgramVkey = _fibonacciProgramVkey; + fibonacciProgramVKey = _fibonacciProgramVKey; } /// @notice The entrypoint for verifying the proof of a fibonacci number. - /// @param proof The encoded proof. - /// @param publicValues The encoded public values. - function verifyFibonacciProof(bytes calldata proof, bytes calldata publicValues) + /// @param _proofBytes The encoded proof. + /// @param _publicValues The encoded public values. + function verifyFibonacciProof(bytes calldata _publicValues, bytes calldata _proofBytes) public view returns (uint32, uint32, uint32) { - ISP1Verifier(verifier).verifyProof(fibonacciProgramVkey, publicValues, proof); - (uint32 n, uint32 a, uint32 b) = abi.decode(publicValues, (uint32, uint32, uint32)); + ISP1Verifier(verifier).verifyProof(fibonacciProgramVKey, _publicValues, _proofBytes); + (uint32 n, uint32 a, uint32 b) = abi.decode(_publicValues, (uint32, uint32, uint32)); return (n, a, b); } } diff --git a/contracts/test/Fibonacci.t.sol b/contracts/test/Fibonacci.t.sol index 7da2c24..bcbcf40 100644 --- a/contracts/test/Fibonacci.t.sol +++ b/contracts/test/Fibonacci.t.sol @@ -41,7 +41,7 @@ contract FibonacciTest is Test { vm.mockCall(verifier, abi.encodeWithSelector(SP1VerifierGateway.verifyProof.selector), abi.encode(true)); - (uint32 n, uint32 a, uint32 b) = fibonacci.verifyFibonacciProof(fixture.proof, fixture.publicValues); + (uint32 n, uint32 a, uint32 b) = fibonacci.verifyFibonacciProof(fixture.publicValues, fixture.proof); assert(n == fixture.n); assert(a == fixture.a); assert(b == fixture.b); @@ -53,6 +53,6 @@ contract FibonacciTest is Test { // Create a fake proof. bytes memory fakeProof = new bytes(fixture.proof.length); - fibonacci.verifyFibonacciProof(fakeProof, fixture.publicValues); + fibonacci.verifyFibonacciProof(fixture.publicValues, fakeProof); } }