Skip to content

Commit

Permalink
fix: use correct Borsh version for signArbitrary (#602)
Browse files Browse the repository at this point in the history
* fix: use correct Borsh version

* fix: version bump
  • Loading branch information
jurevans authored Jan 30, 2024
1 parent e38859c commit 899e151
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion apps/extension/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@namada/extension",
"version": "0.2.1",
"version": "0.2.2",
"description": "Namada Browser Extension",
"repository": "https://github.com/anoma/namada-interface/",
"author": "Heliax Dev <[email protected]>",
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "namada",
"version": "0.2.0",
"version": "0.2.2",
"private": true,
"workspaces": [
"apps/*",
Expand Down
7 changes: 5 additions & 2 deletions packages/shared/lib/src/sdk/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@ use crate::{
sdk::masp::WebShieldedUtils,
utils::{set_panic_hook, to_bytes},
};
use borsh::BorshDeserialize;
use js_sys::Uint8Array;
use namada::core::borsh::BorshDeserialize;
use namada::core::borsh::BorshSerializeExt;
use namada::ledger::{eth_bridge::bridge_pool::build_bridge_pool_tx, pos::common::SecretKey};
use namada::sdk::masp::ShieldedContext;
use namada::sdk::rpc::query_epoch;
Expand Down Expand Up @@ -391,10 +392,12 @@ impl Sdk {
data: String,
) -> Result<JsValue, JsError> {
let hash = Hash::sha256(&data);
// TODO: SecretKey & SigScheme should be imported from key::common, but that is currently
// referring to the wrong import (e.g., pos::common)
let secret = ed25519::SecretKey::from_str(&signing_key)?;
let signature: ed25519::Signature = ed25519::SigScheme::sign(&secret, &hash);

let sig_bytes: &[u8] = &signature.0.to_bytes();
let sig_bytes = signature.serialize_to_vec();

to_js_result((
// Hash
Expand Down

1 comment on commit 899e151

@github-actions
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.