Skip to content

Commit

Permalink
fix(namada): argument order of fetchBondWithSlashing
Browse files Browse the repository at this point in the history
made it match the parameter order in the abci query
(defined in namada/crates/sdk/src/queries/vp/pos.rs)
  • Loading branch information
egasimus committed Sep 27, 2024
1 parent 8116617 commit 0ff1d62
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions packages/namada/NamadaChain.ts
Original file line number Diff line number Diff line change
Expand Up @@ -133,8 +133,8 @@ export default class NamadaChain extends CW.Chain {
fetchValidatorStake (address: string, epoch?: Epoch) {
return this.getConnection().fetchValidatorStakeImpl(address, epoch)
}
fetchBondWithSlashing (validator: string, delegator: string, epoch?: Epoch) {
return this.getConnection().fetchBondWithSlashingImpl(validator, delegator, epoch)
fetchBondWithSlashing (delegator: string, validator: string, epoch?: Epoch) {
return this.getConnection().fetchBondWithSlashingImpl(delegator, validator, epoch)
}
fetchDelegations (address: string) {
return this.getConnection().fetchDelegationsImpl(address)
Expand Down
4 changes: 2 additions & 2 deletions packages/namada/NamadaConnection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -153,8 +153,8 @@ export default class NamadaConnection extends CW.Connection {
fetchValidatorStakeImpl (address: string, epoch?: Epoch.Epoch) {
return PoS.fetchValidatorStake(this, address, epoch)
}
fetchBondWithSlashingImpl (validator: string, delegator: string, epoch?: Epoch.Epoch) {
return PoS.fetchBondWithSlashing(this, validator, delegator, epoch)
fetchBondWithSlashingImpl (delegator: string, validator: string, epoch?: Epoch.Epoch) {
return PoS.fetchBondWithSlashing(this, delegator, validator, epoch)
}
}

Expand Down
4 changes: 2 additions & 2 deletions packages/namada/NamadaPoS.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,11 @@ export async function fetchDelegationsAt (
/** Fetch bond with slashing for a given validator and delegator. */
export async function fetchBondWithSlashing (
connection: NamadaConnection,
validator: Address,
delegator: Address,
validator: Address,
epoch?: number|bigint|string
) {
let query = `/vp/pos/bond_with_slashing/${validator}/${delegator}`
let query = `/vp/pos/bond_with_slashing/${delegator}/${validator}`
if (epoch) query += `/${epoch}`
const totalStake = await connection.abciQuery(query)
return decode(u256, totalStake)
Expand Down

0 comments on commit 0ff1d62

Please sign in to comment.