From ab4cae2acb874c47d52d941ff58d2534c1c1d989 Mon Sep 17 00:00:00 2001 From: syntrust Date: Fri, 13 Sep 2024 11:08:16 +0800 Subject: [PATCH] fix test --- contracts/test/EthStorageContractTest.t.sol | 2 +- contracts/test/TestEthStorageContract.sol | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/contracts/test/EthStorageContractTest.t.sol b/contracts/test/EthStorageContractTest.t.sol index 0e2564b..1844d2b 100644 --- a/contracts/test/EthStorageContractTest.t.sol +++ b/contracts/test/EthStorageContractTest.t.sol @@ -89,7 +89,7 @@ contract EthStorageContractTest is Test { keys[1] = bytes32(uint256(2)); lengths[1] = 30; - sufficientCost = storageContract.upfrontPayment(); + sufficientCost = storageContract.upfrontPayment() + 2 * storageContract.updateCost(); storageContract.putBlobs{value: sufficientCost}(keys, blobIdxs, lengths); assertEq(storageContract.kvEntryCount(), 3); assertEq(storageContract.hash(bytes32(uint256(0))), bytes32(uint256(1 << 8 * 8))); diff --git a/contracts/test/TestEthStorageContract.sol b/contracts/test/TestEthStorageContract.sol index fecae4e..f6ec642 100644 --- a/contracts/test/TestEthStorageContract.sol +++ b/contracts/test/TestEthStorageContract.sol @@ -214,4 +214,8 @@ contract TestEthStorageContract is EthStorageContract { return _mineWithFixedHash0(initHash0, shardId, miner, nonce, encodedSamples, masks, inclusiveProofs, decodeProof); } + + function updateCost() public view returns (uint256) { + return UPDATE_COST; + } }