Skip to content

add upgrade endpoint + upgrade framework #20

add upgrade endpoint + upgrade framework

add upgrade endpoint + upgrade framework #20

GitHub Actions / clippy failed Dec 10, 2024 in 1s

reviewdog [clippy] report

reported by reviewdog 🐶

Findings (10)

ping-pong/src/ping_pong.rs|41 col 32| error[E0308]: mismatched types
--> ping-pong/src/ping_pong.rs:41:32
|
41 | require!(ping_amount > 0, "Ping amount cannot be set to zero");
| ^ expected &_, found integer
|
= note: expected reference &_
found type {integer}
help: consider dereferencing the borrow
|
41 | require!(*ping_amount > 0, "Ping amount cannot be set to zero");
| +
ping-pong/src/ping_pong.rs|41 col 32| error[E0308]: mismatched types
--> ping-pong/src/ping_pong.rs:41:32
|
41 | require!(ping_amount > 0, "Ping amount cannot be set to zero");
| ^ expected &_, found integer
|
= note: expected reference &_
found type {integer}
help: consider dereferencing the borrow
|
41 | require!(*ping_amount > 0, "Ping amount cannot be set to zero");
| +
ping-pong/src/ping_pong.rs|42 col 32| error[E0277]: the trait bound &&multiversx_sc::types::BigUint<<Self as multiversx_sc::contract_base::ContractBase>::Api>: core::borrow::Borrow<multiversx_sc::types::BigUint<<Self as multiversx_sc::contract_base::ContractBase>::Api>> is not satisfied
--> ping-pong/src/ping_pong.rs:42:32
|
42 | self.ping_amount().set(&ping_amount);
| --- ^^^^^^^^^^^^ the trait core::borrow::Borrow<multiversx_sc::types::BigUint<<Self as multiversx_sc::contract_base::ContractBase>::Api>> is not implemented for &&multiversx_sc::types::BigUint<<Self as multiversx_sc::contract_base::ContractBase>::Api>
| |
| required by a bound introduced by this call
|
note: required by a bound in multiversx_sc::imports::SingleValueMapper::<SA, T>::set
--> /home/runner/.cargo/registry/src/index.crates.io-6f17d22bba15001f/multiversx-sc-0.54.6/src/storage/mappers/single_value_mapper.rs:95:13
|
93 | pub fn set(&self, new_value: BT)
| --- required by a bound in this associated function
94 | where
95 | BT: Borrow,
| ^^^^^^^^^ required by this bound in SingleValueMapper::<SA, T>::set
help: consider dereferencing here
|
42 | self.ping_amount().set(&*ping_amount);
| +
help: consider removing the leading &-reference
|
42 - self.ping_amount().set(&ping_amount);
42 + self.ping_amount().set(ping_amount);
|
ping-pong/src/ping_pong.rs|42 col 32| error[E0277]: the trait bound &&multiversx_sc::types::BigUint<<Self as multiversx_sc::contract_base::ContractBase>::Api>: core::borrow::Borrow<multiversx_sc::types::BigUint<<Self as multiversx_sc::contract_base::ContractBase>::Api>> is not satisfied
--> ping-pong/src/ping_pong.rs:42:32
|
42 | self.ping_amount().set(&ping_amount);
| --- ^^^^^^^^^^^^ the trait core::borrow::Borrow<multiversx_sc::types::BigUint<<Self as multiversx_sc::contract_base::ContractBase>::Api>> is not implemented for &&multiversx_sc::types::BigUint<<Self as multiversx_sc::contract_base::ContractBase>::Api>
| |
| required by a bound introduced by this call
|
note: required by a bound in multiversx_sc::imports::SingleValueMapper::<SA, T>::set
--> /home/runner/.cargo/registry/src/index.crates.io-6f17d22bba15001f/multiversx-sc-0.54.6/src/storage/mappers/single_value_mapper.rs:95:13
|
93 | pub fn set(&self, new_value: BT)
| --- required by a bound in this associated function
94 | where
95 | BT: Borrow,
| ^^^^^^^^^ required by this bound in SingleValueMapper::<SA, T>::set
help: consider dereferencing here
|
42 | self.ping_amount().set(&*ping_amount);
| +
help: consider removing the leading &-reference
|
42 - self.ping_amount().set(&ping_amount);
42 + self.ping_amount().set(ping_amount);
|
ping-pong/src/ping_pong.rs|48 col 14| error[E0599]: no method named duration_in_seconds found for reference &Self in the current scope
--> ping-pong/src/ping_pong.rs:48:14
|
48 | self.duration_in_seconds().set(duration_in_seconds);
| ^^^^^^^^^^^^^^^^^^^ method not found in &Self
ping-pong/src/ping_pong.rs|48 col 14| error[E0599]: no method named duration_in_seconds found for reference &Self in the current scope
--> ping-pong/src/ping_pong.rs:48:14
|
48 | self.duration_in_seconds().set(duration_in_seconds);
| ^^^^^^^^^^^^^^^^^^^ method not found in &Self
ping-pong/src/ping_pong.rs|54 col 14| error[E0599]: no method named accepted_payment_token_id found for reference &Self in the current scope
--> ping-pong/src/ping_pong.rs:54:14
|
54 | self.accepted_payment_token_id().set(&token_id);
| ^^^^^^^^^^^^^^^^^^^^^^^^^ method not found in &Self
ping-pong/src/ping_pong.rs|54 col 14| error[E0599]: no method named accepted_payment_token_id found for reference &Self in the current scope
--> ping-pong/src/ping_pong.rs:54:14
|
54 | self.accepted_payment_token_id().set(&token_id);
| ^^^^^^^^^^^^^^^^^^^^^^^^^ method not found in &Self
ping-pong/src/ping_pong.rs|62 col 38| error[E0599]: no method named accepted_payment_token_id found for reference &Self in the current scope
--> ping-pong/src/ping_pong.rs:62:38
|
62 | OptionalValue::Some(self.accepted_payment_token_id().get()),
| ^^^^^^^^^^^^^^^^^^^^^^^^^ method not found in &Self
ping-pong/src/ping_pong.rs|62 col 38| error[E0599]: no method named accepted_payment_token_id found for reference &Self in the current scope
--> ping-pong/src/ping_pong.rs:62:38
|
62 | OptionalValue::Some(self.accepted_payment_token_id().get()),
| ^^^^^^^^^^^^^^^^^^^^^^^^^ method not found in &Self

Filtered Findings (0)

Annotations

Check failure on line 41 in ping-pong/src/ping_pong.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

[clippy] ping-pong/src/ping_pong.rs#L41

error[E0308]: mismatched types
  --> ping-pong/src/ping_pong.rs:41:32
   |
41 |         require!(ping_amount > 0, "Ping amount cannot be set to zero");
   |                                ^ expected `&_`, found integer
   |
   = note: expected reference `&_`
                   found type `{integer}`
help: consider dereferencing the borrow
   |
41 |         require!(*ping_amount > 0, "Ping amount cannot be set to zero");
   |                  +
Raw output
ping-pong/src/ping_pong.rs:41:32:e:error[E0308]: mismatched types
  --> ping-pong/src/ping_pong.rs:41:32
   |
41 |         require!(ping_amount > 0, "Ping amount cannot be set to zero");
   |                                ^ expected `&_`, found integer
   |
   = note: expected reference `&_`
                   found type `{integer}`
help: consider dereferencing the borrow
   |
41 |         require!(*ping_amount > 0, "Ping amount cannot be set to zero");
   |                  +


__END__

Check failure on line 41 in ping-pong/src/ping_pong.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

[clippy] ping-pong/src/ping_pong.rs#L41

error[E0308]: mismatched types
  --> ping-pong/src/ping_pong.rs:41:32
   |
41 |         require!(ping_amount > 0, "Ping amount cannot be set to zero");
   |                                ^ expected `&_`, found integer
   |
   = note: expected reference `&_`
                   found type `{integer}`
help: consider dereferencing the borrow
   |
41 |         require!(*ping_amount > 0, "Ping amount cannot be set to zero");
   |                  +
Raw output
ping-pong/src/ping_pong.rs:41:32:e:error[E0308]: mismatched types
  --> ping-pong/src/ping_pong.rs:41:32
   |
41 |         require!(ping_amount > 0, "Ping amount cannot be set to zero");
   |                                ^ expected `&_`, found integer
   |
   = note: expected reference `&_`
                   found type `{integer}`
help: consider dereferencing the borrow
   |
41 |         require!(*ping_amount > 0, "Ping amount cannot be set to zero");
   |                  +


__END__

Check failure on line 42 in ping-pong/src/ping_pong.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

[clippy] ping-pong/src/ping_pong.rs#L42

error[E0277]: the trait bound `&&multiversx_sc::types::BigUint<<Self as multiversx_sc::contract_base::ContractBase>::Api>: core::borrow::Borrow<multiversx_sc::types::BigUint<<Self as multiversx_sc::contract_base::ContractBase>::Api>>` is not satisfied
  --> ping-pong/src/ping_pong.rs:42:32
   |
42 |         self.ping_amount().set(&ping_amount);
   |                            --- ^^^^^^^^^^^^ the trait `core::borrow::Borrow<multiversx_sc::types::BigUint<<Self as multiversx_sc::contract_base::ContractBase>::Api>>` is not implemented for `&&multiversx_sc::types::BigUint<<Self as multiversx_sc::contract_base::ContractBase>::Api>`
   |                            |
   |                            required by a bound introduced by this call
   |
note: required by a bound in `multiversx_sc::imports::SingleValueMapper::<SA, T>::set`
  --> /home/runner/.cargo/registry/src/index.crates.io-6f17d22bba15001f/multiversx-sc-0.54.6/src/storage/mappers/single_value_mapper.rs:95:13
   |
93 |     pub fn set<BT>(&self, new_value: BT)
   |            --- required by a bound in this associated function
94 |     where
95 |         BT: Borrow<T>,
   |             ^^^^^^^^^ required by this bound in `SingleValueMapper::<SA, T>::set`
help: consider dereferencing here
   |
42 |         self.ping_amount().set(&*ping_amount);
   |                                 +
help: consider removing the leading `&`-reference
   |
42 -         self.ping_amount().set(&ping_amount);
42 +         self.ping_amount().set(ping_amount);
   |
Raw output
ping-pong/src/ping_pong.rs:42:32:e:error[E0277]: the trait bound `&&multiversx_sc::types::BigUint<<Self as multiversx_sc::contract_base::ContractBase>::Api>: core::borrow::Borrow<multiversx_sc::types::BigUint<<Self as multiversx_sc::contract_base::ContractBase>::Api>>` is not satisfied
  --> ping-pong/src/ping_pong.rs:42:32
   |
42 |         self.ping_amount().set(&ping_amount);
   |                            --- ^^^^^^^^^^^^ the trait `core::borrow::Borrow<multiversx_sc::types::BigUint<<Self as multiversx_sc::contract_base::ContractBase>::Api>>` is not implemented for `&&multiversx_sc::types::BigUint<<Self as multiversx_sc::contract_base::ContractBase>::Api>`
   |                            |
   |                            required by a bound introduced by this call
   |
note: required by a bound in `multiversx_sc::imports::SingleValueMapper::<SA, T>::set`
  --> /home/runner/.cargo/registry/src/index.crates.io-6f17d22bba15001f/multiversx-sc-0.54.6/src/storage/mappers/single_value_mapper.rs:95:13
   |
93 |     pub fn set<BT>(&self, new_value: BT)
   |            --- required by a bound in this associated function
94 |     where
95 |         BT: Borrow<T>,
   |             ^^^^^^^^^ required by this bound in `SingleValueMapper::<SA, T>::set`
help: consider dereferencing here
   |
42 |         self.ping_amount().set(&*ping_amount);
   |                                 +
help: consider removing the leading `&`-reference
   |
42 -         self.ping_amount().set(&ping_amount);
42 +         self.ping_amount().set(ping_amount);
   |


__END__

Check failure on line 42 in ping-pong/src/ping_pong.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

[clippy] ping-pong/src/ping_pong.rs#L42

error[E0277]: the trait bound `&&multiversx_sc::types::BigUint<<Self as multiversx_sc::contract_base::ContractBase>::Api>: core::borrow::Borrow<multiversx_sc::types::BigUint<<Self as multiversx_sc::contract_base::ContractBase>::Api>>` is not satisfied
  --> ping-pong/src/ping_pong.rs:42:32
   |
42 |         self.ping_amount().set(&ping_amount);
   |                            --- ^^^^^^^^^^^^ the trait `core::borrow::Borrow<multiversx_sc::types::BigUint<<Self as multiversx_sc::contract_base::ContractBase>::Api>>` is not implemented for `&&multiversx_sc::types::BigUint<<Self as multiversx_sc::contract_base::ContractBase>::Api>`
   |                            |
   |                            required by a bound introduced by this call
   |
note: required by a bound in `multiversx_sc::imports::SingleValueMapper::<SA, T>::set`
  --> /home/runner/.cargo/registry/src/index.crates.io-6f17d22bba15001f/multiversx-sc-0.54.6/src/storage/mappers/single_value_mapper.rs:95:13
   |
93 |     pub fn set<BT>(&self, new_value: BT)
   |            --- required by a bound in this associated function
94 |     where
95 |         BT: Borrow<T>,
   |             ^^^^^^^^^ required by this bound in `SingleValueMapper::<SA, T>::set`
help: consider dereferencing here
   |
42 |         self.ping_amount().set(&*ping_amount);
   |                                 +
help: consider removing the leading `&`-reference
   |
42 -         self.ping_amount().set(&ping_amount);
42 +         self.ping_amount().set(ping_amount);
   |
Raw output
ping-pong/src/ping_pong.rs:42:32:e:error[E0277]: the trait bound `&&multiversx_sc::types::BigUint<<Self as multiversx_sc::contract_base::ContractBase>::Api>: core::borrow::Borrow<multiversx_sc::types::BigUint<<Self as multiversx_sc::contract_base::ContractBase>::Api>>` is not satisfied
  --> ping-pong/src/ping_pong.rs:42:32
   |
42 |         self.ping_amount().set(&ping_amount);
   |                            --- ^^^^^^^^^^^^ the trait `core::borrow::Borrow<multiversx_sc::types::BigUint<<Self as multiversx_sc::contract_base::ContractBase>::Api>>` is not implemented for `&&multiversx_sc::types::BigUint<<Self as multiversx_sc::contract_base::ContractBase>::Api>`
   |                            |
   |                            required by a bound introduced by this call
   |
note: required by a bound in `multiversx_sc::imports::SingleValueMapper::<SA, T>::set`
  --> /home/runner/.cargo/registry/src/index.crates.io-6f17d22bba15001f/multiversx-sc-0.54.6/src/storage/mappers/single_value_mapper.rs:95:13
   |
93 |     pub fn set<BT>(&self, new_value: BT)
   |            --- required by a bound in this associated function
94 |     where
95 |         BT: Borrow<T>,
   |             ^^^^^^^^^ required by this bound in `SingleValueMapper::<SA, T>::set`
help: consider dereferencing here
   |
42 |         self.ping_amount().set(&*ping_amount);
   |                                 +
help: consider removing the leading `&`-reference
   |
42 -         self.ping_amount().set(&ping_amount);
42 +         self.ping_amount().set(ping_amount);
   |


__END__

Check failure on line 48 in ping-pong/src/ping_pong.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

[clippy] ping-pong/src/ping_pong.rs#L48

error[E0599]: no method named `duration_in_seconds` found for reference `&Self` in the current scope
  --> ping-pong/src/ping_pong.rs:48:14
   |
48 |         self.duration_in_seconds().set(duration_in_seconds);
   |              ^^^^^^^^^^^^^^^^^^^ method not found in `&Self`
Raw output
ping-pong/src/ping_pong.rs:48:14:e:error[E0599]: no method named `duration_in_seconds` found for reference `&Self` in the current scope
  --> ping-pong/src/ping_pong.rs:48:14
   |
48 |         self.duration_in_seconds().set(duration_in_seconds);
   |              ^^^^^^^^^^^^^^^^^^^ method not found in `&Self`


__END__

Check failure on line 48 in ping-pong/src/ping_pong.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

[clippy] ping-pong/src/ping_pong.rs#L48

error[E0599]: no method named `duration_in_seconds` found for reference `&Self` in the current scope
  --> ping-pong/src/ping_pong.rs:48:14
   |
48 |         self.duration_in_seconds().set(duration_in_seconds);
   |              ^^^^^^^^^^^^^^^^^^^ method not found in `&Self`
Raw output
ping-pong/src/ping_pong.rs:48:14:e:error[E0599]: no method named `duration_in_seconds` found for reference `&Self` in the current scope
  --> ping-pong/src/ping_pong.rs:48:14
   |
48 |         self.duration_in_seconds().set(duration_in_seconds);
   |              ^^^^^^^^^^^^^^^^^^^ method not found in `&Self`


__END__

Check failure on line 54 in ping-pong/src/ping_pong.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

[clippy] ping-pong/src/ping_pong.rs#L54

error[E0599]: no method named `accepted_payment_token_id` found for reference `&Self` in the current scope
  --> ping-pong/src/ping_pong.rs:54:14
   |
54 |         self.accepted_payment_token_id().set(&token_id);
   |              ^^^^^^^^^^^^^^^^^^^^^^^^^ method not found in `&Self`
Raw output
ping-pong/src/ping_pong.rs:54:14:e:error[E0599]: no method named `accepted_payment_token_id` found for reference `&Self` in the current scope
  --> ping-pong/src/ping_pong.rs:54:14
   |
54 |         self.accepted_payment_token_id().set(&token_id);
   |              ^^^^^^^^^^^^^^^^^^^^^^^^^ method not found in `&Self`


__END__

Check failure on line 54 in ping-pong/src/ping_pong.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

[clippy] ping-pong/src/ping_pong.rs#L54

error[E0599]: no method named `accepted_payment_token_id` found for reference `&Self` in the current scope
  --> ping-pong/src/ping_pong.rs:54:14
   |
54 |         self.accepted_payment_token_id().set(&token_id);
   |              ^^^^^^^^^^^^^^^^^^^^^^^^^ method not found in `&Self`
Raw output
ping-pong/src/ping_pong.rs:54:14:e:error[E0599]: no method named `accepted_payment_token_id` found for reference `&Self` in the current scope
  --> ping-pong/src/ping_pong.rs:54:14
   |
54 |         self.accepted_payment_token_id().set(&token_id);
   |              ^^^^^^^^^^^^^^^^^^^^^^^^^ method not found in `&Self`


__END__

Check failure on line 62 in ping-pong/src/ping_pong.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

[clippy] ping-pong/src/ping_pong.rs#L62

error[E0599]: no method named `accepted_payment_token_id` found for reference `&Self` in the current scope
  --> ping-pong/src/ping_pong.rs:62:38
   |
62 |             OptionalValue::Some(self.accepted_payment_token_id().get()),
   |                                      ^^^^^^^^^^^^^^^^^^^^^^^^^ method not found in `&Self`
Raw output
ping-pong/src/ping_pong.rs:62:38:e:error[E0599]: no method named `accepted_payment_token_id` found for reference `&Self` in the current scope
  --> ping-pong/src/ping_pong.rs:62:38
   |
62 |             OptionalValue::Some(self.accepted_payment_token_id().get()),
   |                                      ^^^^^^^^^^^^^^^^^^^^^^^^^ method not found in `&Self`


__END__

Check failure on line 62 in ping-pong/src/ping_pong.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

[clippy] ping-pong/src/ping_pong.rs#L62

error[E0599]: no method named `accepted_payment_token_id` found for reference `&Self` in the current scope
  --> ping-pong/src/ping_pong.rs:62:38
   |
62 |             OptionalValue::Some(self.accepted_payment_token_id().get()),
   |                                      ^^^^^^^^^^^^^^^^^^^^^^^^^ method not found in `&Self`
Raw output
ping-pong/src/ping_pong.rs:62:38:e:error[E0599]: no method named `accepted_payment_token_id` found for reference `&Self` in the current scope
  --> ping-pong/src/ping_pong.rs:62:38
   |
62 |             OptionalValue::Some(self.accepted_payment_token_id().get()),
   |                                      ^^^^^^^^^^^^^^^^^^^^^^^^^ method not found in `&Self`


__END__