Skip to content

Commit

Permalink
fix WASM sdk submitTransaction API (#96)
Browse files Browse the repository at this point in the history
  • Loading branch information
IgorKhomenko authored Aug 23, 2024
1 parent b7fcdd3 commit 45c413d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
4 changes: 2 additions & 2 deletions consensus/client/src/transaction.rs
Original file line number Diff line number Diff line change
Expand Up @@ -214,12 +214,12 @@ impl Transaction {
self.inner().version = v;
}

#[wasm_bindgen(getter, js_name = lock_time)]
#[wasm_bindgen(getter, js_name = lockTime)]
pub fn get_lock_time(&self) -> u64 {
self.inner().lock_time
}

#[wasm_bindgen(setter, js_name = lock_time)]
#[wasm_bindgen(setter, js_name = lockTime)]
pub fn set_lock_time(&self, v: u64) {
self.inner().lock_time = v;
}
Expand Down
6 changes: 5 additions & 1 deletion rpc/core/src/wasm/message.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1414,7 +1414,11 @@ try_from! ( args: ISubmitTransactionRequest, SubmitTransactionRequest, {
allow_orphan,
}
} else {
from_value(transaction)?
let tx = Transaction::try_cast_from(&transaction)?;
SubmitTransactionRequest {
transaction : tx.as_ref().into(),
allow_orphan,
}
};
Ok(request)
});
Expand Down

0 comments on commit 45c413d

Please sign in to comment.