Skip to content

Commit

Permalink
update (#936)
Browse files Browse the repository at this point in the history
  • Loading branch information
tsachiherman authored Sep 7, 2023
1 parent 16ada04 commit 0a020c7
Showing 1 changed file with 2 additions and 3 deletions.
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

0 comments on commit 0a020c7

Please sign in to comment.