Comments (6)
The code responsible for the function always returning 0:
fn convert(weight: Weight) -> BalanceOf<T> {
<NextFeeMultiplier<T>>::get().saturating_mul_int(Self::weight_to_fee(weight))
}
from ink.
Regarding the observation you made: The 0 is intentional, as the comment indicates, "Equivalent to the newer [seal1][super::api_doc::Version2::weight_to_fee] version but works with ref_time Weight only." (proof_size is set to 0).
The issue you observed is related to the runtime configuration. By changing type FeeMultiplierUpdate = ()
to type FeeMultiplierUpdate = SlowAdjustingFeeUpdate<Self>
in pallet_transaction_payment::Config for Runtime
, you can make it work.
from ink.
@arturoBeccar, please advise if it works for you, and can we close the issue?
from ink.
Hi @smiasojed, recompiling the node on commit f1d8389
, and calling a contract with this function:
#[ink(message)]
pub fn weight_to_fee(&self, gas: u64) -> Balance {
self.env().weight_to_fee(gas)
}
We still obtain 0 with any gas number in e2e.
Any idea on why this is happening?
from ink.
Hi @arturoBeccar,
This is how I tested it:
- I recompiled the substrate-contract-node on commit 'f1d8389.'
- I started the node.
- I added the 'weight_to_fee' message to the Flipper contract.
- I instantiated it.
- I called 'weight_to_fee':
cargo contract call --suri //Alice --manifest-path ../ink/integration-tests/flipper/Cargo.toml --contract 5D4NHEJyj56T7J9TXZwUjmuWBzecFvEunX51GmRmcv1igd8s --message weight_to_fee --args 10
Result Ok(9)
Do you verify it in the same manner?
from ink.
Hi @smiasojed. I tried the suggested steps and it worked correctly. I confirm the issue is now resolved in PR #219 to substrate-contract-node and can be closed. Thanks!
from ink.
Related Issues (20)
- The function `set_contract_storage` in integration test it's missing a size check.
- Linter: Unprotected `terminate_contract`
- Linter: Unprotected `DelegateCall` call
- Immutable contracts allowed to change state via `env` HOT 4
- Add a lint for missing `no_main`
- IIP-3: Allow messages without `&self` receiver; opt out of automatic storage loading HOT 5
- Split up `ink_linting` into two `dylint` libraries HOT 1
- Use standard Github's machines for test jobs
- Linter: Warn about using non-fallible APIs for `Lazy` and `Mapping` HOT 1
- Support expressions for `extension` and `function` during chain extension definition
- Event defintions with generics
- Deprecation of "legacy" inline events HOT 1
- Unify `call-runtime` and `e2e-call-runtime` examples
- Linter: Dangereous `self.env().transferred_value()` pattern
- Linter: Divide before multiply
- Add support and integration test for `caller_is_root`
- Migrate ink! CI from organization runners to standard GitHub runners
- Add links to linter warning details on use.ink
- Cross contract calling produces unsupported code HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ink.