difftreelog
CORE-386 Fix error case
in: master
3 files changed
pallets/common/src/erc.rsdiffbeforeafterboth--- a/pallets/common/src/erc.rs
+++ b/pallets/common/src/erc.rs
@@ -105,7 +105,7 @@
.confirm_sponsorship(caller.as_sub())
.map_err(dispatch_to_evm::<T>)?
{
- return Err("Caller is not set as sponsor".into());
+ return Err("caller is not set as sponsor".into());
}
save(self)
}
@@ -136,7 +136,7 @@
}
_ => {
return Err(Error::Revert(format!(
- "Unknown integer limit \"{}\"",
+ "unknown integer limit \"{}\"",
limit
)))
}
@@ -163,7 +163,7 @@
}
_ => {
return Err(Error::Revert(format!(
- "Unknown boolean limit \"{}\"",
+ "unknown boolean limit \"{}\"",
limit
)))
}
@@ -244,11 +244,11 @@
collections: Vec<address>,
) -> Result<void> {
if collections.is_empty() {
- return Err("No addresses provided".into());
+ return Err("no addresses provided".into());
}
if collections.len() >= OwnerRestrictedSet::bound() {
return Err(Error::Revert(format!(
- "Out of bound: {} >= {}",
+ "out of bound: {} >= {}",
collections.len(),
OwnerRestrictedSet::bound()
)));
@@ -261,7 +261,7 @@
let mut bv = OwnerRestrictedSet::new();
for i in collections {
bv.try_insert(crate::eth::map_eth_to_id(&i).ok_or_else(|| {
- Error::Revert("Can't convert address into collection id".into())
+ Error::Revert("can't convert address into collection id".into())
})?)
.map_err(|e| Error::Revert(format!("{:?}", e)))?;
}
@@ -286,7 +286,7 @@
access: Some(match mode {
0 => AccessMode::Normal,
1 => AccessMode::AllowList,
- _ => return Err("Not supported access mode".into()),
+ _ => return Err("not supported access mode".into()),
}),
..Default::default()
};
tests/src/eth/contractSponsoring.test.tsdiffbeforeafterboth233 const ss58Format = (api.registry.getChainProperties())!.toJSON().ss58Format;233 const ss58Format = (api.registry.getChainProperties())!.toJSON().ss58Format;234 expect(collectionSub.sponsorship.isUnconfirmed).to.be.true;234 expect(collectionSub.sponsorship.isUnconfirmed).to.be.true;235 expect(collectionSub.sponsorship.asUnconfirmed.toHuman()).to.be.eq(evmToAddress(sponsor, Number(ss58Format)));235 expect(collectionSub.sponsorship.asUnconfirmed.toHuman()).to.be.eq(evmToAddress(sponsor, Number(ss58Format)));236 await expect(collectionEvm.methods.confirmCollectionSponsorship().call()).to.be.rejectedWith('Caller is not set as sponsor');236 await expect(collectionEvm.methods.confirmCollectionSponsorship().call()).to.be.rejectedWith('caller is not set as sponsor');237237238 await collectionEvm.methods.confirmCollectionSponsorship().send({from: sponsor});238 await collectionEvm.methods.confirmCollectionSponsorship().send({from: sponsor});239 collectionSub = (await getDetailedCollectionInfo(api, collectionId))!;239 collectionSub = (await getDetailedCollectionInfo(api, collectionId))!;302 const ss58Format = (api.registry.getChainProperties())!.toJSON().ss58Format;302 const ss58Format = (api.registry.getChainProperties())!.toJSON().ss58Format;303 expect(collectionSub.sponsorship.isUnconfirmed).to.be.true;303 expect(collectionSub.sponsorship.isUnconfirmed).to.be.true;304 expect(collectionSub.sponsorship.asUnconfirmed.toHuman()).to.be.eq(evmToAddress(sponsor, Number(ss58Format)));304 expect(collectionSub.sponsorship.asUnconfirmed.toHuman()).to.be.eq(evmToAddress(sponsor, Number(ss58Format)));305 await expect(collectionEvm.methods.confirmCollectionSponsorship().call()).to.be.rejectedWith('Caller is not set as sponsor');305 await expect(collectionEvm.methods.confirmCollectionSponsorship().call()).to.be.rejectedWith('caller is not set as sponsor');306 const sponsorCollection = evmCollection(web3, sponsor, collectionIdAddress);306 const sponsorCollection = evmCollection(web3, sponsor, collectionIdAddress);307 await sponsorCollection.methods.confirmCollectionSponsorship().send();307 await sponsorCollection.methods.confirmCollectionSponsorship().send();308 collectionSub = (await getDetailedCollectionInfo(api, collectionId))!;308 collectionSub = (await getDetailedCollectionInfo(api, collectionId))!;tests/src/eth/createCollection.test.tsdiffbeforeafterboth--- a/tests/src/eth/createCollection.test.ts
+++ b/tests/src/eth/createCollection.test.ts
@@ -80,7 +80,7 @@
expect(collectionSub.sponsorship.isUnconfirmed).to.be.true;
const ss58Format = (api.registry.getChainProperties())!.toJSON().ss58Format;
expect(collectionSub.sponsorship.asUnconfirmed.toHuman()).to.be.eq(evmToAddress(sponsor, Number(ss58Format)));
- await expect(collectionEvm.methods.confirmCollectionSponsorship().call()).to.be.rejectedWith('Caller is not set as sponsor');
+ await expect(collectionEvm.methods.confirmCollectionSponsorship().call()).to.be.rejectedWith('caller is not set as sponsor');
const sponsorCollection = evmCollection(web3, sponsor, collectionIdAddress);
await sponsorCollection.methods.confirmCollectionSponsorship().send();
collectionSub = (await getDetailedCollectionInfo(api, collectionId))!;
@@ -208,7 +208,7 @@
const sponsorCollection = evmCollection(web3, sponsor, collectionIdAddress);
await expect(sponsorCollection.methods
.confirmCollectionSponsorship()
- .call()).to.be.rejectedWith('Caller is not set as sponsor');
+ .call()).to.be.rejectedWith('caller is not set as sponsor');
}
{
await expect(contractEvmFromNotOwner.methods
@@ -225,6 +225,6 @@
const collectionEvm = evmCollection(web3, owner, collectionIdAddress);
await expect(collectionEvm.methods
.setCollectionLimit('badLimit', 'true')
- .call()).to.be.rejectedWith('Unknown boolean limit "badLimit"');
+ .call()).to.be.rejectedWith('unknown boolean limit "badLimit"');
});
});
\ No newline at end of file