Skip to content

Commit

Permalink
fix(namada): return type of pos_validator_metadata
Browse files Browse the repository at this point in the history
  • Loading branch information
egasimus committed Aug 26, 2024
1 parent cda1f93 commit d4589cd
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 30 deletions.
4 changes: 2 additions & 2 deletions packages/namada/pkg/fadroma_namada.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,9 @@ export class Decode {
static pos_parameters(source: Uint8Array): object;
/**
* @param {Uint8Array} source
* @returns {object}
* @returns {any}
*/
static pos_validator_metadata(source: Uint8Array): object;
static pos_validator_metadata(source: Uint8Array): any;
/**
* @param {Uint8Array} source
* @returns {object}
Expand Down
2 changes: 1 addition & 1 deletion packages/namada/pkg/fadroma_namada.js
Original file line number Diff line number Diff line change
Expand Up @@ -429,7 +429,7 @@ export class Decode {
}
/**
* @param {Uint8Array} source
* @returns {object}
* @returns {any}
*/
static pos_validator_metadata(source) {
try {
Expand Down
41 changes: 14 additions & 27 deletions packages/namada/src/decode.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,32 +41,19 @@ impl Decode {
#[wasm_bindgen]
pub fn storage_keys () -> Result<Object, Error> {
Ok(to_object! {
"epochDuration" =
get_epoch_duration_storage_key().to_string(),
"epochsPerYear" =
get_epochs_per_year_key().to_string(),
"gasCostTable" =
get_gas_cost_key().to_string(),
"gasScale" =
get_gas_scale_key().to_string(),
"implicitVpCodeHash" =
get_implicit_vp_key().to_string(),
"maspEpochMultipler" =
get_masp_epoch_multiplier_key().to_string(),
"maspFeePaymentGasLimit" =
get_masp_fee_payment_gas_limit_key().to_string(),
"maxBlockGas" =
get_max_block_gas_key().to_string(),
"maxProposalBytes" =
get_max_proposal_bytes_key().to_string(),
"maxTxBytes" =
get_max_tx_bytes_key().to_string(),
"isNativeTokenTransferable" =
get_native_token_transferable_key().to_string(),
"txAllowlist" =
get_tx_allowlist_storage_key().to_string(),
"vpAllowlist" =
get_vp_allowlist_storage_key().to_string(),
"epochDuration" = get_epoch_duration_storage_key().to_string(),
"epochsPerYear" = get_epochs_per_year_key().to_string(),
"gasCostTable" = get_gas_cost_key().to_string(),
"gasScale" = get_gas_scale_key().to_string(),
"implicitVpCodeHash" = get_implicit_vp_key().to_string(),
"maspEpochMultipler" = get_masp_epoch_multiplier_key().to_string(),
"maspFeePaymentGasLimit" = get_masp_fee_payment_gas_limit_key().to_string(),
"maxBlockGas" = get_max_block_gas_key().to_string(),
"maxProposalBytes" = get_max_proposal_bytes_key().to_string(),
"maxTxBytes" = get_max_tx_bytes_key().to_string(),
"isNativeTokenTransferable" = get_native_token_transferable_key().to_string(),
"txAllowlist" = get_tx_allowlist_storage_key().to_string(),
"vpAllowlist" = get_vp_allowlist_storage_key().to_string(),
})
}

Expand Down Expand Up @@ -221,7 +208,7 @@ impl Decode {
}

#[wasm_bindgen]
pub fn pos_validator_metadata (source: Uint8Array) -> Result<Object, Error> {
pub fn pos_validator_metadata (source: Uint8Array) -> Result<JsValue, JsValue> {
auto_decode!(to_bytes(&source) => ValidatorMetaData)
}

Expand Down

0 comments on commit d4589cd

Please sign in to comment.