File tree Expand file tree Collapse file tree 6 files changed +47
-5
lines changed
engine/access/rest/common/models Expand file tree Collapse file tree 6 files changed +47
-5
lines changed Original file line number Diff line number Diff line change @@ -63,10 +63,27 @@ func (b *Block) Build(
63
63
}
64
64
65
65
b .Links = self
66
- b .BlockStatus = blockStatus .String ()
66
+
67
+ var status BlockStatus
68
+ status .Build (blockStatus )
69
+ b .BlockStatus = & status
70
+
67
71
return nil
68
72
}
69
73
74
+ func (b * BlockStatus ) Build (status flow.BlockStatus ) {
75
+ switch status {
76
+ case flow .BlockStatusUnknown :
77
+ * b = BLOCK_UNKNOWN
78
+ case flow .BlockStatusFinalized :
79
+ * b = BLOCK_FINALIZED
80
+ case flow .BlockStatusSealed :
81
+ * b = BLOCK_SEALED
82
+ default :
83
+ * b = ""
84
+ }
85
+ }
86
+
70
87
func (b * BlockPayload ) Build (payload * flow.Payload ) error {
71
88
var blockSeal BlockSeals
72
89
err := blockSeal .Build (payload .Seals )
Original file line number Diff line number Diff line change @@ -15,3 +15,9 @@ const (
15
15
SUCCESS_RESULT = SUCCESS_TransactionExecution
16
16
FAILURE_RESULT = FAILURE_TransactionExecution
17
17
)
18
+
19
+ const (
20
+ BLOCK_UNKNOWN = UNKNOWN_BlockStatus
21
+ BLOCK_FINALIZED = FINALIZED_BlockStatus
22
+ BLOCK_SEALED = SEALED_BlockStatus
23
+ )
Original file line number Diff line number Diff line change @@ -14,5 +14,5 @@ type Block struct {
14
14
ExecutionResult * ExecutionResult `json:"execution_result,omitempty"`
15
15
Expandable * BlockExpandable `json:"_expandable,omitempty"`
16
16
Links * Links `json:"_links,omitempty"`
17
- BlockStatus string `json:"block_status"`
17
+ BlockStatus * BlockStatus `json:"block_status"`
18
18
}
Original file line number Diff line number Diff line change
1
+ /*
2
+ * Access API
3
+ *
4
+ * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
5
+ *
6
+ * API version: 1.0.0
7
+ * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
8
+ */
9
+ package models
10
+
11
+ // BlockStatus : This value indicates the status of a block.
12
+ type BlockStatus string
13
+
14
+ // List of BlockStatus
15
+ const (
16
+ UNKNOWN_BlockStatus BlockStatus = "BLOCK_UNKNOWN"
17
+ FINALIZED_BlockStatus BlockStatus = "BLOCK_FINALIZED"
18
+ SEALED_BlockStatus BlockStatus = "BLOCK_SEALED"
19
+ )
Original file line number Diff line number Diff line change @@ -325,4 +325,4 @@ require (
325
325
replace github.com/ipfs/boxo => github.com/onflow/boxo v0.0.0-20240201202436-f2477b92f483
326
326
327
327
// TODO: remove after PR on onflow/flow https://github.com/onflow/flow/pull/1539 merged and flow version bumped
328
- replace github.com/onflow/flow => github.com/The-K-R-O-K/flow v0.0.0-20250114135520-4c3fcf5ad9dd
328
+ replace github.com/onflow/flow => github.com/The-K-R-O-K/flow v0.0.0-20250123124738-e797132bf24e
Original file line number Diff line number Diff line change @@ -89,8 +89,8 @@ github.com/Shopify/sarama v1.19.0/go.mod h1:FVkBWblsNy7DGZRfXLU0O9RCGt5g3g3yEuWX
89
89
github.com/Shopify/toxiproxy v2.1.4+incompatible /go.mod h1:OXgGpZ6Cli1/URJOF1DMxUHB2q5Ap20/P/eIdh4G0pI =
90
90
github.com/StackExchange/wmi v1.2.1 h1:VIkavFPXSjcnS+O8yTq7NI32k0R5Aj+v39y29VYDOSA =
91
91
github.com/StackExchange/wmi v1.2.1 /go.mod h1:rcmrprowKIVzvc+NUiLncP2uuArMWLCbu9SBzvHz7e8 =
92
- github.com/The-K-R-O-K/flow v0.0.0-20250114135520-4c3fcf5ad9dd h1:M01VqGZiWoPVl0lHkQR6XHJsINWbtp03OsPGzJz0ZrY =
93
- github.com/The-K-R-O-K/flow v0.0.0-20250114135520-4c3fcf5ad9dd /go.mod h1:bIL/+5+AGyJnFfLGejMkZRGJiXopqdkMvkJNCjrpIa4 =
92
+ github.com/The-K-R-O-K/flow v0.0.0-20250123124738-e797132bf24e h1:6dvEjGvcHRHDYSZjCdaJtBAk3CjR+AhXc9EOe+3CtyY =
93
+ github.com/The-K-R-O-K/flow v0.0.0-20250123124738-e797132bf24e /go.mod h1:bIL/+5+AGyJnFfLGejMkZRGJiXopqdkMvkJNCjrpIa4 =
94
94
github.com/VictoriaMetrics/fastcache v1.12.2 h1:N0y9ASrJ0F6h0QaC3o6uJb3NIZ9VKLjCM7NQbSmF7WI =
95
95
github.com/VictoriaMetrics/fastcache v1.12.2 /go.mod h1:AmC+Nzz1+3G2eCPapF6UcsnkThDcMsQicp4xDukwJYI =
96
96
github.com/VividCortex/gohistogram v1.0.0 /go.mod h1:Pf5mBqqDxYaXu3hDrrU+w6nw50o/4+TcAqDqk/vUH7g =
You can’t perform that action at this time.
0 commit comments