difftreelog
path: Add has_sponsor function to solidity. Fix confirm_sponsorship.
in: master
2 files changed
pallets/evm-contract-helpers/src/eth.rsdiffbeforeafterboth78 Ok((*sponsor.as_eth(), sponsor_sub))77 Ok((*sponsor.as_eth(), sponsor_sub))79 }78 }7980 fn has_sponsor(&self, contract_address: address) -> Result<bool> {81 Ok(Pallet::<T>::get_sponsor(contract_address).is_some())82 }808381 fn sponsoring_enabled(&self, contract_address: address) -> Result<bool> {84 fn sponsoring_enabled(&self, contract_address: address) -> Result<bool> {82 Ok(<Pallet<T>>::sponsoring_mode(contract_address) != SponsoringModeT::Disabled)85 Ok(<Pallet<T>>::sponsoring_mode(contract_address) != SponsoringModeT::Disabled)pallets/evm-contract-helpers/src/lib.rsdiffbeforeafterboth168 match Sponsoring::<T>::get(contract) {168 match Sponsoring::<T>::get(contract) {169 SponsorshipState::Unconfirmed(sponsor) => {169 SponsorshipState::Unconfirmed(sponsor) => {170 ensure!(sponsor == *sender, Error::<T>::NoPermission);170 ensure!(sponsor == *sender, Error::<T>::NoPermission);171 Sponsoring::<T>::mutate_exists(contract, |state| {172 *state = Some(SponsorshipState::<T::CrossAccountId>::Confirmed(173 sponsor.clone(),174 ))175 });171 Ok(())176 Ok(())172 }177 }173 SponsorshipState::Disabled | SponsorshipState::Confirmed(_) => {178 SponsorshipState::Disabled | SponsorshipState::Confirmed(_) => {