git.delta.rocks / unique-network / refs/commits / 7a21c0bed6bb

difftreelog

path: Add has_sponsor function to solidity. Fix confirm_sponsorship.

Trubnikov Sergey2022-08-05parent: #f5f392c.patch.diff
in: master

2 files changed

modifiedpallets/evm-contract-helpers/src/eth.rsdiffbeforeafterboth
78 Ok((*sponsor.as_eth(), sponsor_sub))77 Ok((*sponsor.as_eth(), sponsor_sub))
79 }78 }
79
80 fn has_sponsor(&self, contract_address: address) -> Result<bool> {
81 Ok(Pallet::<T>::get_sponsor(contract_address).is_some())
82 }
8083
81 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)
modifiedpallets/evm-contract-helpers/src/lib.rsdiffbeforeafterboth
168 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(_) => {