Skip to content

Commit

Permalink
Boil types, first handler
Browse files Browse the repository at this point in the history
  • Loading branch information
elffjs committed Dec 16, 2024
1 parent 1781562 commit d29530c
Show file tree
Hide file tree
Showing 4 changed files with 1,486 additions and 2 deletions.
17 changes: 15 additions & 2 deletions internal/services/staking/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,28 @@ package staking

import (
"context"
"time"

"github.com/DIMO-Network/identity-api/internal/services/models"
cmodels "github.com/DIMO-Network/identity-api/internal/services/models"
"github.com/DIMO-Network/identity-api/models"
"github.com/DIMO-Network/shared/db"
"github.com/DIMO-Network/shared/dbtypes"
)

type Handler struct {
dbs db.Store
}

func (h *Handler) HandleStaked(ctx context.Context, event *models.ContractEventData, args *Staked) error {
func (h *Handler) HandleStaked(ctx context.Context, event *cmodels.ContractEventData, args *Staked) error {

stake := models.Stake{

Check failure on line 19 in internal/services/staking/handler.go

View workflow job for this annotation

GitHub Actions / tests

declared and not used: stake

Check failure on line 19 in internal/services/staking/handler.go

View workflow job for this annotation

GitHub Actions / tests

declared and not used: stake

Check failure on line 19 in internal/services/staking/handler.go

View workflow job for this annotation

GitHub Actions / lint

declared and not used: stake (typecheck)
ID: int(args.StakeId.Int64()),
Owner: args.User.Bytes(),
Level: int(args.Level),
Points: int(args.Points.Int64()),
Amount: dbtypes.IntToDecimal(args.Amount),
StakedAt: event.Block.Time,
EndsAt: time.Unix(args.LockEndTime.Int64(), 0),
}
return nil
}
2 changes: 2 additions & 0 deletions models/boil_table_names.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit d29530c

Please sign in to comment.