Skip to content

Commit 918fb41

Browse files
committed
more explicit failure
1 parent 52dc392 commit 918fb41

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

precompiles/src/crowdloan.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ where
4848
) -> EvmResult<CrowdloanInfo> {
4949
let crowdloan = pallet_crowdloan::Crowdloans::<R>::get(crowdloan_id).ok_or(
5050
PrecompileFailure::Error {
51-
exit_status: ExitError::InvalidRange,
51+
exit_status: ExitError::Other("Crowdloan not found".into()),
5252
},
5353
)?;
5454

@@ -80,7 +80,7 @@ where
8080
let coldkey = R::AccountId::from(coldkey.0);
8181
let contribution = pallet_crowdloan::Contributions::<R>::get(crowdloan_id, coldkey).ok_or(
8282
PrecompileFailure::Error {
83-
exit_status: ExitError::InvalidRange,
83+
exit_status: ExitError::Other("Crowdloan or contribution not found".into()),
8484
},
8585
)?;
8686

precompiles/src/leasing.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ where
5353
fn get_lease(_handle: &mut impl PrecompileHandle, lease_id: u32) -> EvmResult<LeaseInfo> {
5454
let lease =
5555
pallet_subtensor::SubnetLeases::<R>::get(lease_id).ok_or(PrecompileFailure::Error {
56-
exit_status: ExitError::InvalidRange,
56+
exit_status: ExitError::Other("Lease not found".into()),
5757
})?;
5858

5959
Ok(LeaseInfo {
@@ -89,7 +89,7 @@ where
8989
fn get_lease_id_for_subnet(_handle: &mut impl PrecompileHandle, netuid: u16) -> EvmResult<u32> {
9090
let lease_id = pallet_subtensor::SubnetUidToLeaseId::<R>::get(NetUid::from(netuid)).ok_or(
9191
PrecompileFailure::Error {
92-
exit_status: ExitError::InvalidRange,
92+
exit_status: ExitError::Other("Lease not found for netuid".into()),
9393
},
9494
)?;
9595

0 commit comments

Comments
 (0)