Sorry no, Mandos is single-shard only
And167100369 activity
And167100369 commented on Hi guys! Is there a way to view stacktrace logs on the arwen wasm-vm when running mandos tests?
Writing "traceGas" = true at the start will show you how much gas is used and where, not sure we have some special stack trace option.
And167100369 commented on Hey guys. What would be the best way to get a slice from a VecMapper?
VecMapper means you have each item in a different place in storage, so the only way to take a subset is to iterate.
And167100369 commented on Hi! Does anyone know how I can implement this with EGLD payment?
We're slowly moving away from the payment arguments, in hindsight they seem to have caused more confusion than necessary. There's a release on the way very soon which clears things up a little bit, stay tuned.
And167100369 commented on I see. But sometimes it is not recommended updating a smart contract as it can mess up everything. In Elrond, is it safe to do it? The common approach is to update the SC? Or the common approach is using a Proxy?
You need to make sure that the new storage layout is compatible with the old layout. It is also good practice to deploy your contract from a multisig so the upgradability is not a security vulnerability. In principle it is the same as having a proxy contract, only more convenient
And167100369 commented on what's diff between ManagedOption and rust Option?
It provides a very small boost in performance when working with managed types. You shouldn't worry too much about it though, Option works absolutely fine.
And167100369 commented on Hi guys! I noticed the following. I am working with 18 decimals so I sometimes need to define numbers like: managed_biguint!(1_000_000_000_000_000_000) This works as expected. However, if I use one more zero: managed_biguint!(10_000_000_000_000_000_000) it yields the incorrect number... even thoug... Read more
Behind the scenes `BigUint`s are actually `BigInt`s with restrictions. This means it will go through an i64 in the process, even if you declare it as u64. Just do `managed_biguint!(1_000_000_000_000_000_000) * 10` or something of the sort
And167100369 commented on Does anyone know how I can turn a U64 to a ManagedBuffer ?
ManagedBuffer::from(my_u64.to_bytes_be())
And167100369 commented on Does anybody have a "clean code" way of getting an option value and requiring it to be existent?
option.unwrap_or_else(|| sc_panic("should be some"))
And167100369 commented on hi there does anyone know if Elrond can be run as a private chain?
It can, but making the setup can be tricky and it is not documented. I don't think anyone outside Elrond has ever done it
And167100369 commented on Hi! Rust-sc related question. Is possible to test callbacks using mandos integration tests?
Absolutely. With mandos you get the single-shard scenario, in which the callback always comes after the async call,
And167100369 commented on Good Evening, rust sc related question. Is there a possibility provide a callback after async call as a simple closure directly? Or Do I need to define a function annotated with #[callback] and use that as following -> self.callbacks().my_callback()?
There's a lot of magic involved there, in the way callbacks currently work. It's made to look like a simple call, but the full process is that a callback proxy gets generated ( self.callbacks().my_callback() is a callback proxy in fact, it is a generated method), which serializes the proxy closure and saves it temporarily to storage. The callback then loads this data from storage and uses it. The syntax is what it is, it is the cleanest I could get. I would have loved to make it look like an actual Rust closure, but the compiler doesn't let me hack so deep.
And167100369 commented on Hello, is it possible to pass callback as a raw closure instead of defining separate function with #[callback] annotation and then pointing to that function?
Yes, we have #[callback_raw], but you need to know what you are doing. That one will catch all callbacks and does no processing at all
And167100369 commented on thank you for your answer I understand the advantages and drawbacks of the first method. However for the second, I won't know who are the owner of which nfts. I could scan them all and read their data but that would cost potentially cost a lot of gas right?
You could map users to their NFTs in storage, it's not expensive. It's not necessarily in the spirit of ESDT, more similar to how you would do it on Ethereum, but then you have control over them and can destroy them at will.
And167100369 commented on Is there a new way to get nested contract call results?
Results from sync calls no longer get added to your results, so you're only getting the results of the imnediate call. If A calls B calls C, A only gets results from B. If it A needs anything from C, B has to pass it explicitly
And167100369 commented on Hello there how can i define Managed Byte Array for my contract he: ManagedByteArray cannot define as such throws error "the trait ManagedTypeApi is not implemented for BigUint<::Api>" is there something we can do ?
It's a ManagedBYTEArray, you can't put BigUint in it. Just use a ManagedVec
And167100369 commented on How can I return a message/status code from a SC call without using require!?
sc_panic!("your message") is the way. sc_error! has been removed.
And167100369 commented on Hi ! i have a small problem : i don't know how to implement SetMapper on a struct who implement M: ManagedTypeApi.
I have 2 parameteres who use ManagedBuffer, so i had to declare M: ManagedTypeApi in the definition of my struct but i can't make setMapper>, M isn't recognized . Anyone kn... Read more
SetMapper
And167100369 commented on Hi. What is the best practice to test smart contract? mandos or interaction snippets?
Start with some unit tests in Rust. Rust integration tests that generate Mandos coming soon. Until then, Mandos by hand. Finally, some snippets. Snippets are hard, so we usually leave then until the end
And167100369 commented on When we use a ManagedVec, we can't get the index 0 cause it's used to store the lenght?
ManagedVec starts from 0, just like regular Vec
And167100369 commented on Hello, I want to send a message along the prize to a user, is there a way to concatenate a string with a value? I tried it like this but it doesnt work: self.send().direct_egld( &winner_address, &prize, (b"You won the lottery with ID: {}! Congratulati... Read more
We have a formatter that does this elegantly, although I never tried to format tx data. Should be something like sc_format("message {}", args) but I need to check
And167100369 commented on Hello, I am using this ( WithdrawTransaction from Delegator ) Is there a way to know the amount of EGLD received from withdraw after this ? If I use callback here.. can I know the amount of EGLD recevied ?
Calling self.call_value().egld_value() in the callback should yield the amount you got
And167100369 commented on How do we make mandos understand and interpret our structs as stored in the contract?
You'll have to serialize the representation by hand, there are some tricks you can use, like "u32:0|u32:5|u64:7" for example for a struct with 3 fields, 2x u32 and 1x u64
And167100369 commented on Are you also on M1 architecture?
no, but still, you can try the nightly nightly-x86_64-unknown-linux-gnu
And167100369 commented on This is how I understand it too .. And that leads me to next question .. Why would Elrond be better for the description you just wrote, than say .. Avalanche ?
What was said about hashing is true for any blockchain. Elrond is just faster and cheaper in general, so for this task too.
And167100369 commented on I need to store N Exabytes data in a "custom cloud" indexed by a blockchain .. Is Elrond suitable for such usage ?
Storage on the blockchain is expensive, what you usually do is to store a hash of the data on chain. You can use that hash to prove the data has not been tampered with. You can also store some metadata, indexes, etc. . .. depends on what you need with it
And167100369 commented on Hello! Can i make an app for my university diploma on Elrond, what i mean : is Elrond free to use for a student ?
Free to use for anyone. There is only the transaction cost, but even that is zero if you deploy it on the testnet, which is enough to prove your worth and get the diploma.
And167100369 commented on Where do I import the BigUint type from?
You cannot import it because it is not a type, it is a generic (or type argument). It gets replaced automatically with ArwenBigUint in wasm mode and RustBigUint in debug mode. If you need it in a struct, you have to pass it on as a generic, e.g. MyStruct