Skip to content

Commit

Permalink
feat: add canWithdraw to unbonds endpoints (#95)
Browse files Browse the repository at this point in the history
  • Loading branch information
mateuszjasiuk authored Aug 7, 2024
1 parent 4cc06bf commit 624b522
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion swagger-codegen.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"npmName": "@anomaorg/namada-indexer-client",
"npmVersion": "0.0.20"
"npmVersion": "0.0.21"
}

6 changes: 3 additions & 3 deletions swagger.yml
Original file line number Diff line number Diff line change
Expand Up @@ -712,7 +712,7 @@ components:
type: string
Unbond:
type: object
required: [validator, amount, withdrawEpoch, withdrawTime, currentTime]
required: [validator, amount, withdrawEpoch, withdrawTime, canWithdraw]
properties:
validator:
$ref: '#/components/schemas/Validator'
Expand All @@ -722,8 +722,8 @@ components:
type: string
withdrawTime:
type: string
currentTime:
type: string
canWithdraw:
type: boolean
Withdraw:
type: object
required: [amount, withdrawEpoch]
Expand Down
4 changes: 2 additions & 2 deletions webserver/src/response/pos.rs
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ pub struct Unbond {
pub validator: ValidatorWithId,
pub withdraw_epoch: String,
pub withdraw_time: String,
pub current_time: String,
pub can_withdraw: bool,
}

#[derive(Clone, Debug, Deserialize, Serialize)]
Expand Down Expand Up @@ -200,7 +200,7 @@ impl Unbond {
validator: ValidatorWithId::from(db_validator),
withdraw_epoch: withdraw_epoch.to_string(),
withdraw_time: withdraw_time.to_string(),
current_time: time_now.to_string(),
can_withdraw: chain_state.last_processed_epoch >= withdraw_epoch,
}
}
}
Expand Down

0 comments on commit 624b522

Please sign in to comment.