Skip to content

Commit

Permalink
Fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
dmirgaleev committed May 3, 2024
1 parent cdb6266 commit f384916
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 18 deletions.
2 changes: 1 addition & 1 deletion cmd/mempool/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ type Indexer struct {
// Filters -
type Filters struct {
Accounts []*config.Alias[config.Contract] `validate:"max=50" yaml:"accounts"`

Check failure on line 29 in cmd/mempool/config/config.go

View workflow job for this annotation

GitHub Actions / Linter

tag is not aligned, should be: validate:"max=50" yaml:"accounts" (tagalign)
Kinds []string `validate:"required,min=1,dive,oneof=activate_account ballot delegation double_baking_evidence double_endorsement_evidence endorsement endorsement_with_slot origination proposals reveal seed_nonce_revelation transaction register_global_constant" yaml:"kinds"`
Kinds []string `validate:"required,min=1,dive,oneof=activate_account ballot delegation double_baking_evidence double_endorsement_evidence endorsement endorsement_with_dal endorsement_with_slot origination proposals reveal seed_nonce_revelation transaction register_global_constant" yaml:"kinds"`
}

// Addresses -
Expand Down
14 changes: 0 additions & 14 deletions cmd/mempool/handlers.go
Original file line number Diff line number Diff line change
Expand Up @@ -337,20 +337,6 @@ func (indexer *Indexer) handleEndorsement(ctx context.Context, tx bun.IDB, conte
return nil
}

func (indexer *Indexer) handleEndorsementWithDal(ctx context.Context, tx bun.IDB, content node.Content, operation models.MempoolOperation) error {
var endorsement models.Endorsement
if err := json.Unmarshal(content.Body, &endorsement); err != nil {
return err
}
endorsement.MempoolOperation = operation

if err := createModel(ctx, tx, &endorsement); err != nil {
return err
}
indexer.endorsements <- &endorsement
return nil
}

func (indexer *Indexer) handleEndorsementWithSlot(ctx context.Context, tx bun.IDB, content node.Content, operation models.MempoolOperation) error {
var endorsementWithSlot node.EndorsementWithSlot
if err := json.Unmarshal(content.Body, &endorsementWithSlot); err != nil {
Expand Down
2 changes: 1 addition & 1 deletion cmd/mempool/models/dal_publish_commitment.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@ type DalPublishCommitment struct {
SlotHeader SlotHeader `comment:"Published slot header" json:"slot_header"`
}


type SlotHeader struct {
SlotIndex int `json:"slot_index"`
Commitment string `json:"commitment"`
CommitmentProof string `json:"commitment_proof"`
}

// SetMempoolOperation -
func (i *DalPublishCommitment) SetMempoolOperation(operaiton MempoolOperation) {
i.MempoolOperation = operaiton
Expand Down
5 changes: 3 additions & 2 deletions cmd/mempool/models/mempool_operation.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ const (

// DefaultConstraint -
type DefaultConstraint interface {
Ballot | ActivateAccount | Delegation | DoubleBaking | DoubleEndorsing | DoublePreendorsing | Endorsement |
Ballot | ActivateAccount | Delegation | DoubleBaking | DoubleEndorsing | DoublePreendorsing | Endorsement |
NonceRevelation | Origination | Preendorsement | Proposal | RegisterGlobalConstant | Reveal | SetDepositsLimit |
Transaction | TransferTicket | TxRollupCommit | TxRollupDispatchTickets | TxRollupFinalizeCommitment | TxRollupOrigination |
TxRollupRejection | TxRollupRemoveCommitment | TxRollupReturnBond | TxRollupSubmitBatch | VdfRevelation | IncreasePaidStorage |
Expand Down Expand Up @@ -208,6 +208,8 @@ func getModelByKind(kind string) (interface{}, error) {
return &DoubleEndorsing{}, nil
case node.KindEndorsement:
return &Endorsement{}, nil
case node.KindEndorsementWithDal:
return &Endorsement{}, nil
case node.KindNonceRevelation:
return &NonceRevelation{}, nil
case node.KindOrigination:
Expand Down Expand Up @@ -271,7 +273,6 @@ func getModelByKind(kind string) (interface{}, error) {
case node.KindDalPublishCommitment:
return &DalPublishCommitment{}, nil


default:
return nil, errors.Wrap(node.ErrUnknownKind, kind)
}
Expand Down

0 comments on commit f384916

Please sign in to comment.