Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

soroban-cli: wrap token fails with valid inputs in sandbox mode #936

Merged
merged 2 commits into from
Sep 7, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions cmd/soroban-cli/src/commands/lab/token/wrap.rs
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,6 @@ impl Cmd {
}))?;

let contract_id = vec_to_hash(&res)?;

state.update(&h);
self.config.set_state(&state)?;
Ok(stellar_strkey::Contract(contract_id.0).to_string())
Expand Down Expand Up @@ -136,9 +135,9 @@ impl Cmd {
///
/// Might return an error
pub fn vec_to_hash(res: &ScVal) -> Result<Hash, XdrError> {
if let ScVal::Bytes(res_hash) = &res {
if let ScVal::Address(ScAddress::Contract(res_contract)) = &res {
let mut hash_bytes: [u8; 32] = [0; 32];
for (i, b) in res_hash.iter().enumerate() {
for (i, b) in res_contract.0.iter().enumerate() {
hash_bytes[i] = *b;
}
Ok(Hash(hash_bytes))
Expand Down
Loading