From c547bde1f7780b6a24bf5812448bcbfd2ad7abb8 Mon Sep 17 00:00:00 2001 From: sirius Date: Fri, 29 Mar 2024 15:24:40 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=F0=9F=90=9B=20requestAllocateDatacap=20?= =?UTF-8?q?check=20if=20matched?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ✅ Closes: #363 --- src/v0.8/module/storage/Storages.sol | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/v0.8/module/storage/Storages.sol b/src/v0.8/module/storage/Storages.sol index de616f6b..8faf396d 100644 --- a/src/v0.8/module/storage/Storages.sol +++ b/src/v0.8/module/storage/Storages.sol @@ -132,6 +132,12 @@ contract Storages is uint64[] memory _ids, uint64[] memory _claimIds ) external { + require( + MatchingType.State.Completed == + roles.matchings().getMatchingState(_matchingId), + "invalid matching state" + ); + require(isStorageExpiration(_matchingId) != true, "Storage expiration"); if (_ids.length != _claimIds.length) { revert Errors.ParamLengthMismatch(_ids.length, _claimIds.length); @@ -322,6 +328,12 @@ contract Storages is validNextDatacapAllocation(this, _matchingId) returns (uint64) { + require( + MatchingType.State.Completed == + roles.matchings().getMatchingState(_matchingId), + "invalid matching state" + ); + ( , ,