Skip to content

Commit

Permalink
fix: bump babylon and apply breaking changes (#101)
Browse files Browse the repository at this point in the history
  • Loading branch information
jrwbabylonlab authored Dec 27, 2024
1 parent 3bc234a commit 4b3aae4
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 14 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ withdrawal transactions.

### Requirements

- **Go**: Version `1.23.2` or higher is required.
- **Go**: Version `1.23.4` or higher is required.
- **MongoDB**: A MongoDB instance with replica sets enabled is required

1. Clone the repository
Expand Down
2 changes: 1 addition & 1 deletion contrib/images/babylon-staking-indexer/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM golang:1.23-alpine AS builder
FROM golang:1.23.4-alpine AS builder

ARG VERSION="HEAD"

Expand Down
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
module github.com/babylonlabs-io/babylon-staking-indexer

go 1.23.1
go 1.23.4

require (
cosmossdk.io/math v1.4.0
github.com/avast/retry-go/v4 v4.5.1
github.com/babylonlabs-io/babylon v0.18.0
github.com/babylonlabs-io/babylon v1.0.0-rc.2
github.com/babylonlabs-io/staking-queue-client v0.4.7-0.20241212112557-9ac7de686075
github.com/btcsuite/btcd v0.24.3-0.20241011125836-24eb815168f4
github.com/btcsuite/btcd/btcec/v2 v2.3.4
Expand Down
8 changes: 2 additions & 6 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -1427,12 +1427,8 @@ github.com/aws/aws-sdk-go v1.44.122/go.mod h1:y4AeaBuwd2Lk+GepC1E9v0qOiTws0MIWAX
github.com/aws/aws-sdk-go v1.44.312 h1:llrElfzeqG/YOLFFKjg1xNpZCFJ2xraIi3PqSuP+95k=
github.com/aws/aws-sdk-go v1.44.312/go.mod h1:aVsgQcEevwlmQ7qHE9I3h+dtQgpqhFB+i8Phjh7fkwI=
github.com/aws/aws-sdk-go-v2 v0.18.0/go.mod h1:JWVYvqSMppoMJC0x5wdwiImzgXTI9FuZwxzkQq9wy+g=
github.com/babylonlabs-io/babylon v0.18.0 h1:phMY/GiR9N5MpD3XCmvyPpZkc1I3kTM9yX+Cf0h3OnU=
github.com/babylonlabs-io/babylon v0.18.0/go.mod h1:sT+KG2U+M0tDMNZZ2L5CwlXX0OpagGEs56BiWXqaZFw=
github.com/babylonlabs-io/staking-queue-client v0.4.7-0.20241203052145-e50972fc19c9 h1:4UGpRPm5oxj3P8QNrGrkiQtlQYTAgsWzXJFi8oD7zpY=
github.com/babylonlabs-io/staking-queue-client v0.4.7-0.20241203052145-e50972fc19c9/go.mod h1:n3fr3c+9LNiJlyETmcrVk94Zn76rAADhGZKxX+rVf+Q=
github.com/babylonlabs-io/staking-queue-client v0.4.7-0.20241212104643-06828f6e25d5 h1:b89cYr2MuW8bzKDVIHT8kPKD1dQygCERYpTtR8eGmcY=
github.com/babylonlabs-io/staking-queue-client v0.4.7-0.20241212104643-06828f6e25d5/go.mod h1:n3fr3c+9LNiJlyETmcrVk94Zn76rAADhGZKxX+rVf+Q=
github.com/babylonlabs-io/babylon v1.0.0-rc.2 h1:H7OpEDNNOXyC+9TUo4vVYLlHNhOQ8m9KqWP1qzjEt0c=
github.com/babylonlabs-io/babylon v1.0.0-rc.2/go.mod h1:B8ma8IjGUEKhmoRfwv60Qa7DtUXssCgtmD89huQ4+5I=
github.com/babylonlabs-io/staking-queue-client v0.4.7-0.20241212112557-9ac7de686075 h1:gB+jslBkK5/ror4sn9NHldKjLu4nE88jgD43d2L3osc=
github.com/babylonlabs-io/staking-queue-client v0.4.7-0.20241212112557-9ac7de686075/go.mod h1:n3fr3c+9LNiJlyETmcrVk94Zn76rAADhGZKxX+rVf+Q=
github.com/benbjohnson/clock v1.1.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA=
Expand Down
8 changes: 4 additions & 4 deletions internal/services/events.go
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ func (s *Service) validateBTCDelegationCreatedEvent(event *bstypes.EventBTCDeleg
// Validate the event state
if event.NewState != bstypes.BTCDelegationStatus_PENDING.String() {
return types.NewValidationFailedError(
fmt.Errorf("invalid delegation state from Babylon: expected PENDING, got %s", event.NewState),
fmt.Errorf("invalid delegation state from Babylon when processing EventBTCDelegationCreated: expected PENDING, got %s", event.NewState),
)
}

Expand Down Expand Up @@ -311,7 +311,7 @@ func (s *Service) validateBTCDelegationUnbondedEarlyEvent(ctx context.Context, e
// Validate the event state
if event.NewState != bstypes.BTCDelegationStatus_UNBONDED.String() {
return false, types.NewValidationFailedError(
fmt.Errorf("invalid delegation state from Babylon: expected UNBONDED, got %s", event.NewState),
fmt.Errorf("invalid delegation state from Babylon when processing EventBTCDelgationUnbondedEarly: expected UNBONDED, got %s", event.NewState),
)
}

Expand Down Expand Up @@ -348,9 +348,9 @@ func (s *Service) validateBTCDelegationExpiredEvent(ctx context.Context, event *
}

// Validate the event state
if event.NewState != bstypes.BTCDelegationStatus_UNBONDED.String() {
if event.NewState != bstypes.BTCDelegationStatus_EXPIRED.String() {
return false, types.NewValidationFailedError(
fmt.Errorf("invalid delegation state from Babylon: expected UNBONDED, got %s", event.NewState),
fmt.Errorf("invalid delegation state from Babylon when processing EventBTCDelegationExpired: expected EXPIRED, got %s", event.NewState),
)
}

Expand Down

0 comments on commit 4b3aae4

Please sign in to comment.