WIP: fix withdraw reduce balance and add initial tests #37
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Why is this error
called
Result::unwrap()on an
Errvalue: GenericErr { msg: "Invalid hash format" }
occuring when i use Rust Nightly and runcd ./packages/secret-contracts/nunya-contract && cargo test
The error is occuring on this Line 829 of code https://github.com/svub/nunya/pull/37/files#diff-d6a7ac3c294e496b72f7d1f5bdecff8f47d478f755c2ae3c04e695690020e950R829, and i believe the cause is because i haven't used the right format for the
input_hash
orsignature
property values of thePrivContractHandleMsg
struct on Line 824-825. But even in this example https://github.com/SecretSaturn/SecretPath/blob/main/TNLS-Samples/Storage/src/contract.rs#L399 they also use the same format for those values.I tried changing the hash value to
Region::from_slice("message_hash".as_bytes())
by usinguse cosmwasm_vm::memory::{Region};
, but it wouldn't let me import that sinceuse cosmwasm_vm::memory
is a "private module".Error
Note that I've also been using this codebase for reference https://github.com/CosmWasm/cosmwasm/blob/main/contracts/hackatom/src/contract.rs