Skip to content

Commit

Permalink
Revert
Browse files Browse the repository at this point in the history
  • Loading branch information
gRoussac committed Dec 13, 2024
1 parent d13e08e commit 3dc2428
Show file tree
Hide file tree
Showing 6 changed files with 72 additions and 84 deletions.
Binary file modified pkg-nodejs/casper_rust_wasm_sdk_bg.wasm
Binary file not shown.
42 changes: 21 additions & 21 deletions pkg-nodejs/casper_rust_wasm_sdk_bg.wasm.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -311,6 +311,27 @@ export const __wbg_get_geterainfooptions_node_address: (a: number) => [number, n
export const __wbg_get_geterainfooptions_verbosity: (a: number) => number;
export const __wbg_set_geterainfooptions_maybe_block_identifier: (a: number, b: number) => void;
export const __wbg_geterainfooptions_free: (a: number, b: number) => void;
export const __wbg_bytes_free: (a: number, b: number) => void;
export const bytes_new: () => number;
export const bytes_fromUint8Array: (a: any) => number;
export const __wbg_argssimple_free: (a: number, b: number) => void;
export const __wbg_eraid_free: (a: number, b: number) => void;
export const eraid_new: (a: bigint) => number;
export const eraid_value: (a: number) => bigint;
export const __wbg_peerentry_free: (a: number, b: number) => void;
export const peerentry_node_id: (a: number) => [number, number];
export const peerentry_address: (a: number) => [number, number];
export const __wbg_casperwallet_free: (a: number, b: number) => void;
export const casperwallet_new: () => number;
export const casperwallet_signDeploy: (a: number, b: number, c: number, d: number) => any;
export const casperwallet_signDeployHash: (a: number, b: number, c: number, d: number, e: number) => any;
export const casperwallet_signMessage: (a: number, b: number, c: number, d: number, e: number) => any;
export const casperwallet_connect: (a: number) => any;
export const casperwallet_disconnect: (a: number) => any;
export const casperwallet_isConnected: (a: number) => any;
export const casperwallet_getVersion: (a: number) => any;
export const casperwallet_getActivePublicKey: (a: number) => any;
export const casperwallet_switchAccount: (a: number) => any;
export const __wbg_dictionaryaddr_free: (a: number, b: number) => void;
export const dictionaryaddr_new: (a: number, b: number) => [number, number, number];
export const __wbg_urefaddr_free: (a: number, b: number) => void;
Expand Down Expand Up @@ -482,27 +503,6 @@ export const accountHashToBase64Key: (a: number, b: number) => [number, number,
export const getTimestamp: () => any;
export const encodeLowerBlake2b: (a: number, b: number) => any;
export const makeDictionaryItemKey: (a: number, b: number, c: number) => [number, number, number, number];
export const __wbg_bytes_free: (a: number, b: number) => void;
export const bytes_new: () => number;
export const bytes_fromUint8Array: (a: any) => number;
export const __wbg_argssimple_free: (a: number, b: number) => void;
export const __wbg_eraid_free: (a: number, b: number) => void;
export const eraid_new: (a: bigint) => number;
export const eraid_value: (a: number) => bigint;
export const __wbg_peerentry_free: (a: number, b: number) => void;
export const peerentry_node_id: (a: number) => [number, number];
export const peerentry_address: (a: number) => [number, number];
export const __wbg_casperwallet_free: (a: number, b: number) => void;
export const casperwallet_new: () => number;
export const casperwallet_signDeploy: (a: number, b: number, c: number, d: number) => any;
export const casperwallet_signDeployHash: (a: number, b: number, c: number, d: number, e: number) => any;
export const casperwallet_signMessage: (a: number, b: number, c: number, d: number, e: number) => any;
export const casperwallet_connect: (a: number) => any;
export const casperwallet_disconnect: (a: number) => any;
export const casperwallet_isConnected: (a: number) => any;
export const casperwallet_getVersion: (a: number) => any;
export const casperwallet_getActivePublicKey: (a: number) => any;
export const casperwallet_switchAccount: (a: number) => any;
export const __wbg_path_free: (a: number, b: number) => void;
export const path_new: (a: any) => number;
export const path_fromArray: (a: any) => number;
Expand Down
42 changes: 21 additions & 21 deletions pkg/casper_rust_wasm_sdk.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2287,6 +2287,27 @@ export interface InitOutput {
readonly __wbg_get_geterainfooptions_verbosity: (a: number) => number;
readonly __wbg_set_geterainfooptions_maybe_block_identifier: (a: number, b: number) => void;
readonly __wbg_geterainfooptions_free: (a: number, b: number) => void;
readonly __wbg_bytes_free: (a: number, b: number) => void;
readonly bytes_new: () => number;
readonly bytes_fromUint8Array: (a: any) => number;
readonly __wbg_argssimple_free: (a: number, b: number) => void;
readonly __wbg_eraid_free: (a: number, b: number) => void;
readonly eraid_new: (a: bigint) => number;
readonly eraid_value: (a: number) => bigint;
readonly __wbg_peerentry_free: (a: number, b: number) => void;
readonly peerentry_node_id: (a: number) => [number, number];
readonly peerentry_address: (a: number) => [number, number];
readonly __wbg_casperwallet_free: (a: number, b: number) => void;
readonly casperwallet_new: () => number;
readonly casperwallet_signDeploy: (a: number, b: number, c: number, d: number) => any;
readonly casperwallet_signDeployHash: (a: number, b: number, c: number, d: number, e: number) => any;
readonly casperwallet_signMessage: (a: number, b: number, c: number, d: number, e: number) => any;
readonly casperwallet_connect: (a: number) => any;
readonly casperwallet_disconnect: (a: number) => any;
readonly casperwallet_isConnected: (a: number) => any;
readonly casperwallet_getVersion: (a: number) => any;
readonly casperwallet_getActivePublicKey: (a: number) => any;
readonly casperwallet_switchAccount: (a: number) => any;
readonly __wbg_dictionaryaddr_free: (a: number, b: number) => void;
readonly dictionaryaddr_new: (a: number, b: number) => [number, number, number];
readonly __wbg_urefaddr_free: (a: number, b: number) => void;
Expand Down Expand Up @@ -2458,27 +2479,6 @@ export interface InitOutput {
readonly getTimestamp: () => any;
readonly encodeLowerBlake2b: (a: number, b: number) => any;
readonly makeDictionaryItemKey: (a: number, b: number, c: number) => [number, number, number, number];
readonly __wbg_bytes_free: (a: number, b: number) => void;
readonly bytes_new: () => number;
readonly bytes_fromUint8Array: (a: any) => number;
readonly __wbg_argssimple_free: (a: number, b: number) => void;
readonly __wbg_eraid_free: (a: number, b: number) => void;
readonly eraid_new: (a: bigint) => number;
readonly eraid_value: (a: number) => bigint;
readonly __wbg_peerentry_free: (a: number, b: number) => void;
readonly peerentry_node_id: (a: number) => [number, number];
readonly peerentry_address: (a: number) => [number, number];
readonly __wbg_casperwallet_free: (a: number, b: number) => void;
readonly casperwallet_new: () => number;
readonly casperwallet_signDeploy: (a: number, b: number, c: number, d: number) => any;
readonly casperwallet_signDeployHash: (a: number, b: number, c: number, d: number, e: number) => any;
readonly casperwallet_signMessage: (a: number, b: number, c: number, d: number, e: number) => any;
readonly casperwallet_connect: (a: number) => any;
readonly casperwallet_disconnect: (a: number) => any;
readonly casperwallet_isConnected: (a: number) => any;
readonly casperwallet_getVersion: (a: number) => any;
readonly casperwallet_getActivePublicKey: (a: number) => any;
readonly casperwallet_switchAccount: (a: number) => any;
readonly __wbg_path_free: (a: number, b: number) => void;
readonly path_new: (a: any) => number;
readonly path_fromArray: (a: any) => number;
Expand Down
Binary file modified pkg/casper_rust_wasm_sdk_bg.wasm
Binary file not shown.
42 changes: 21 additions & 21 deletions pkg/casper_rust_wasm_sdk_bg.wasm.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -311,6 +311,27 @@ export const __wbg_get_geterainfooptions_node_address: (a: number) => [number, n
export const __wbg_get_geterainfooptions_verbosity: (a: number) => number;
export const __wbg_set_geterainfooptions_maybe_block_identifier: (a: number, b: number) => void;
export const __wbg_geterainfooptions_free: (a: number, b: number) => void;
export const __wbg_bytes_free: (a: number, b: number) => void;
export const bytes_new: () => number;
export const bytes_fromUint8Array: (a: any) => number;
export const __wbg_argssimple_free: (a: number, b: number) => void;
export const __wbg_eraid_free: (a: number, b: number) => void;
export const eraid_new: (a: bigint) => number;
export const eraid_value: (a: number) => bigint;
export const __wbg_peerentry_free: (a: number, b: number) => void;
export const peerentry_node_id: (a: number) => [number, number];
export const peerentry_address: (a: number) => [number, number];
export const __wbg_casperwallet_free: (a: number, b: number) => void;
export const casperwallet_new: () => number;
export const casperwallet_signDeploy: (a: number, b: number, c: number, d: number) => any;
export const casperwallet_signDeployHash: (a: number, b: number, c: number, d: number, e: number) => any;
export const casperwallet_signMessage: (a: number, b: number, c: number, d: number, e: number) => any;
export const casperwallet_connect: (a: number) => any;
export const casperwallet_disconnect: (a: number) => any;
export const casperwallet_isConnected: (a: number) => any;
export const casperwallet_getVersion: (a: number) => any;
export const casperwallet_getActivePublicKey: (a: number) => any;
export const casperwallet_switchAccount: (a: number) => any;
export const __wbg_dictionaryaddr_free: (a: number, b: number) => void;
export const dictionaryaddr_new: (a: number, b: number) => [number, number, number];
export const __wbg_urefaddr_free: (a: number, b: number) => void;
Expand Down Expand Up @@ -482,27 +503,6 @@ export const accountHashToBase64Key: (a: number, b: number) => [number, number,
export const getTimestamp: () => any;
export const encodeLowerBlake2b: (a: number, b: number) => any;
export const makeDictionaryItemKey: (a: number, b: number, c: number) => [number, number, number, number];
export const __wbg_bytes_free: (a: number, b: number) => void;
export const bytes_new: () => number;
export const bytes_fromUint8Array: (a: any) => number;
export const __wbg_argssimple_free: (a: number, b: number) => void;
export const __wbg_eraid_free: (a: number, b: number) => void;
export const eraid_new: (a: bigint) => number;
export const eraid_value: (a: number) => bigint;
export const __wbg_peerentry_free: (a: number, b: number) => void;
export const peerentry_node_id: (a: number) => [number, number];
export const peerentry_address: (a: number) => [number, number];
export const __wbg_casperwallet_free: (a: number, b: number) => void;
export const casperwallet_new: () => number;
export const casperwallet_signDeploy: (a: number, b: number, c: number, d: number) => any;
export const casperwallet_signDeployHash: (a: number, b: number, c: number, d: number, e: number) => any;
export const casperwallet_signMessage: (a: number, b: number, c: number, d: number, e: number) => any;
export const casperwallet_connect: (a: number) => any;
export const casperwallet_disconnect: (a: number) => any;
export const casperwallet_isConnected: (a: number) => any;
export const casperwallet_getVersion: (a: number) => any;
export const casperwallet_getActivePublicKey: (a: number) => any;
export const casperwallet_switchAccount: (a: number) => any;
export const __wbg_path_free: (a: number, b: number) => void;
export const path_new: (a: any) => number;
export const path_fromArray: (a: any) => number;
Expand Down
30 changes: 9 additions & 21 deletions src/types/key.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ impl Key {
}

#[wasm_bindgen(js_name = "fromAccount")]
pub fn from_account_js_alias(key: AccountHash) -> Self {
Self::from_account(key)
pub fn from_account(key: AccountHash) -> Self {
Self(_Key::Account(key.into()))
}

#[wasm_bindgen]
Expand Down Expand Up @@ -117,8 +117,8 @@ impl Key {
}

#[wasm_bindgen(js_name = "toFormattedString")]
pub fn to_formatted_string_js_alias(&self) -> String {
Self::to_formatted_string(self)
pub fn to_formatted_string(&self) -> String {
_Key::to_formatted_string(self.0)
}

#[wasm_bindgen(js_name = "fromFormattedString")]
Expand Down Expand Up @@ -165,8 +165,11 @@ impl Key {
}

#[wasm_bindgen(js_name = "intoURef")]
pub fn into_uref_js_alias(self) -> Option<URef> {
Self::into_uref(self)
pub fn into_uref(self) -> Option<URef> {
match self.0 {
_Key::URef(uref) => Some(uref.into()),
_ => None,
}
}

#[wasm_bindgen(js_name = "urefToHash")]
Expand Down Expand Up @@ -198,21 +201,6 @@ impl Key {
})
})
}

pub fn to_formatted_string(&self) -> String {
_Key::to_formatted_string(self.0)
}

pub fn from_account(key: AccountHash) -> Self {
Self(_Key::Account(key.into()))
}

pub fn into_uref(self) -> Option<URef> {
match self.0 {
_Key::URef(uref) => Some(uref.into()),
_ => None,
}
}
}

impl From<Key> for _Key {
Expand Down

0 comments on commit 3dc2428

Please sign in to comment.