Questions tagged [rust]
Questions about the Rust programming language, the primary language used in the Substrate ecosystem.
264
questions
5
votes
3
answers
246
views
Missing trait problem
Hello the following code snippet is giving me headaches:
mod items;
pub use super::*;
pub use crate::roles::items::*;
pub type BalanceOf<T> = <<T as pallet::Config>::Currency as ...
5
votes
1
answer
609
views
Cannot infer type for type parameter 'T'
I have a function using the following 2 types:
pub type BalanceOf<T> = <<T as pallet::Config>::Currency as Currency<<T as frame_system::Config>::AccountId>>::Balance;
pub ...
0
votes
2
answers
65
views
How to match the versions or Susbstrate upstream in my project's dependancies? [closed]
I'm new to substrate and follow this tutorial: https://docs.substrate.io/tutorials/v3/kitties/pt1/.
I'm facing problem in this line : we'll need to import serde. Add this to your pallet's Cargo.toml ...
4
votes
1
answer
133
views
Rust ink. Division wont return a number with float point
I'm trying to calculate a value of token by using division operator,
it will return a number higher then 1, but never returns
here is the code of the price calculation:
#[ink(message)]
...
4
votes
3
answers
93
views
Build the Substrate Kitties Chain Tutorial Cargo Error
I was following the tutorial: https://docs.substrate.io/tutorials/v3/kitties/pt1/
and as said in the tutorial I installed kickstart using: cargo install kickstart
And after that cloned a copy of the ...
7
votes
1
answer
163
views
Filter Events with subxt over multiple threads
I'm working on a project that uses Substrate in the backend. The System I am working on is written with Elixir and so I have a rustler NIF (Erlang/Elixir Native Function interface) for interacting ...
3
votes
1
answer
56
views
NewContractNotFunded error using contracts pallet with version 4.0.0-dev
I'm running into an issue where I cannot deploy contracts to my chain, any help is appreciated.
I'm using the same setup as: https://github.com/paritytech/substrate/blob/...
4
votes
1
answer
93
views
Rust Ink - Execution finished with debug buffer: panicked at 'called `Result::unwrap()` on an `Err` value: CalleeTrapped'
I'm trying to make cross contracts calls on already deployed contract, I'm running the local subtrate node in debug mode, and I'm getting the following message when trying to preform cross contracts.
...
1
vote
1
answer
37
views
How can I use a specific version of ink? [closed]
I want to use a specific version of ink!, version 3.0.0-rc7 for example. How can I define that?
5
votes
1
answer
221
views
How to set base_fee and len_fee to zero?
I was trying to modify the transaction fee and for that I only want the congestion of the network. In FeeDetails, that is present in the transaction-payment pallet, we have three fields, i.e., ...
2
votes
1
answer
598
views
How to convert Vec<u8> to u32 in Substrate runtime?
AFAIK, we can't use std in Substrate WASM runtime, what is the most effective way to convert a string to a number in runtime.
For example: string "48" in Vec to 48 in u32.
5
votes
1
answer
69
views
How to I submit UTF-8 text to an extrinsic?
I'm making a pallet that takes a string as the input. I tested it and it works well with English words, but when I try Vietnamese, the input box turned red and I couldn't submit the extrinsic. How can ...
7
votes
2
answers
159
views
What is Gossamer and how does it compare to Substrate?
Gossamer is a Go-lang implementation of the Polkadot host. What does this mean, and how does this compare to Substrate?
Could Gossamer be the Go-variant of Substrate for developers exploring ...
10
votes
6
answers
392
views
How to call extrinsic functions externally from rust?
I need to call extrinsic functions, for example utility -> batch(calls) or utility -> batchAll(calls). Which library do I need to use for this?
I can't find those examples in the web.