Skip to content

Commit

Permalink
renamed mock to datasubmit and added desired confidence to config
Browse files Browse the repository at this point in the history
  • Loading branch information
chandiniv1 committed Aug 3, 2023
1 parent 4ebf625 commit 964575d
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions da/avail/avail.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,11 @@ import (
)

type Config struct {
Seed string `json:"seed"`
ApiURL string `json:"api_url"`
Size int `json:"size"`
AppID int `json:"app_id"`
Seed string `json:"seed"`
ApiURL string `json:"api_url"`
Size int `json:"size"`
AppID int `json:"app_id"`
confidence float32 `json:"confidence"`
}

type DataAvailabilityLayerClient struct {
Expand Down Expand Up @@ -92,7 +93,7 @@ func (c *DataAvailabilityLayerClient) SubmitBlock(ctx context.Context, block *ty
}

// CheckBlockAvailability queries DA layer to check data availability of block.
func (a *DataAvailabilityLayerClient) CheckBlockAvailability(ctx context.Context, dataLayerHeight uint64) da.ResultCheckBlock {
func (c *DataAvailabilityLayerClient) CheckBlockAvailability(ctx context.Context, dataLayerHeight uint64) da.ResultCheckBlock {

type Confidence struct {
Block uint32 `json:"block"`
Expand Down Expand Up @@ -132,7 +133,7 @@ func (a *DataAvailabilityLayerClient) CheckBlockAvailability(ctx context.Context
Code: da.StatusSuccess,
DAHeight: uint64(confidenceObject.Block),
},
DataAvailable: confidenceObject.Confidence > 92,
DataAvailable: confidenceObject.Confidence > float64(c.config.confidence),
}
}

Expand Down

0 comments on commit 964575d

Please sign in to comment.