Skip to content

Commit 5da79e6

Browse files
authored
Merge pull request #1696 from onflow/peter/contracts-endpoints-results
Add result to contract deployments
2 parents 73ab60e + b7c99b4 commit 5da79e6

8 files changed

Lines changed: 74 additions & 28 deletions

openapi/experimental/go-client-generated/api/swagger.yaml

Lines changed: 55 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -2347,6 +2347,7 @@ components:
23472347
execution_effort: execution_effort
23482348
transaction_handler_owner: transaction_handler_owner
23492349
transaction_handler_uuid: transaction_handler_uuid
2350+
is_placeholder: true
23502351
cancelled_transaction_id: null
23512352
id: id
23522353
executed_transaction_id: null
@@ -2357,14 +2358,16 @@ components:
23572358
_links:
23582359
_self: _self
23592360
contract_id: contract_id
2360-
is_placeholder: true
23612361
block_height: block_height
2362+
event_index: event_index
2363+
code_hash: code_hash
2364+
result: null
2365+
is_placeholder: true
23622366
tx_index: tx_index
23632367
_expandable:
23642368
result: http://example.com/aeiou
2369+
code: http://example.com/aeiou
23652370
transaction: http://example.com/aeiou
2366-
event_index: event_index
2367-
code_hash: code_hash
23682371
transaction: null
23692372
_expandable:
23702373
result: http://example.com/aeiou
@@ -2454,6 +2457,7 @@ components:
24542457
execution_effort: execution_effort
24552458
transaction_handler_owner: transaction_handler_owner
24562459
transaction_handler_uuid: transaction_handler_uuid
2460+
is_placeholder: true
24572461
cancelled_transaction_id: null
24582462
id: id
24592463
executed_transaction_id: null
@@ -2464,14 +2468,16 @@ components:
24642468
_links:
24652469
_self: _self
24662470
contract_id: contract_id
2467-
is_placeholder: true
24682471
block_height: block_height
2472+
event_index: event_index
2473+
code_hash: code_hash
2474+
result: null
2475+
is_placeholder: true
24692476
tx_index: tx_index
24702477
_expandable:
24712478
result: http://example.com/aeiou
2479+
code: http://example.com/aeiou
24722480
transaction: http://example.com/aeiou
2473-
event_index: event_index
2474-
code_hash: code_hash
24752481
transaction: null
24762482
_expandable:
24772483
result: http://example.com/aeiou
@@ -2588,6 +2594,11 @@ components:
25882594
$ref: "#/components/schemas/Identifier"
25892595
cancelled_transaction_id:
25902596
$ref: "#/components/schemas/Identifier"
2597+
is_placeholder:
2598+
type: boolean
2599+
description: "True if the scheduled transaction was created during bootstrapping\
2600+
\ based on the current chain state, not based on a protocol event. When\
2601+
\ true, block_height, transaction_id, tx_index, and event_index are absent."
25912602
transaction:
25922603
$ref: "#/components/schemas/Transaction"
25932604
result:
@@ -2630,6 +2641,7 @@ components:
26302641
execution_effort: execution_effort
26312642
transaction_handler_owner: transaction_handler_owner
26322643
transaction_handler_uuid: transaction_handler_uuid
2644+
is_placeholder: true
26332645
cancelled_transaction_id: null
26342646
id: id
26352647
executed_transaction_id: null
@@ -2640,14 +2652,16 @@ components:
26402652
_links:
26412653
_self: _self
26422654
contract_id: contract_id
2643-
is_placeholder: true
26442655
block_height: block_height
2656+
event_index: event_index
2657+
code_hash: code_hash
2658+
result: null
2659+
is_placeholder: true
26452660
tx_index: tx_index
26462661
_expandable:
26472662
result: http://example.com/aeiou
2663+
code: http://example.com/aeiou
26482664
transaction: http://example.com/aeiou
2649-
event_index: event_index
2650-
code_hash: code_hash
26512665
transaction: null
26522666
_expandable:
26532667
result: http://example.com/aeiou
@@ -2729,7 +2743,6 @@ components:
27292743
required:
27302744
- _expandable
27312745
- address
2732-
- code
27332746
- code_hash
27342747
- contract_id
27352748
type: object
@@ -2767,6 +2780,8 @@ components:
27672780
\ block_height, transaction_id, tx_index, and event_index are absent."
27682781
transaction:
27692782
$ref: "#/components/schemas/Transaction"
2783+
result:
2784+
$ref: "#/components/schemas/TransactionResult"
27702785
_expandable:
27712786
$ref: "#/components/schemas/ContractDeployment__expandable"
27722787
_links:
@@ -2778,14 +2793,16 @@ components:
27782793
_links:
27792794
_self: _self
27802795
contract_id: contract_id
2781-
is_placeholder: true
27822796
block_height: block_height
2797+
event_index: event_index
2798+
code_hash: code_hash
2799+
result: null
2800+
is_placeholder: true
27832801
tx_index: tx_index
27842802
_expandable:
27852803
result: http://example.com/aeiou
2804+
code: http://example.com/aeiou
27862805
transaction: http://example.com/aeiou
2787-
event_index: event_index
2788-
code_hash: code_hash
27892806
transaction: null
27902807
ContractsResponse:
27912808
required:
@@ -2807,29 +2824,33 @@ components:
28072824
_links:
28082825
_self: _self
28092826
contract_id: contract_id
2810-
is_placeholder: true
28112827
block_height: block_height
2828+
event_index: event_index
2829+
code_hash: code_hash
2830+
result: null
2831+
is_placeholder: true
28122832
tx_index: tx_index
28132833
_expandable:
28142834
result: http://example.com/aeiou
2835+
code: http://example.com/aeiou
28152836
transaction: http://example.com/aeiou
2816-
event_index: event_index
2817-
code_hash: code_hash
28182837
transaction: null
28192838
- transaction_id: null
28202839
address: null
28212840
code: ""
28222841
_links:
28232842
_self: _self
28242843
contract_id: contract_id
2825-
is_placeholder: true
28262844
block_height: block_height
2845+
event_index: event_index
2846+
code_hash: code_hash
2847+
result: null
2848+
is_placeholder: true
28272849
tx_index: tx_index
28282850
_expandable:
28292851
result: http://example.com/aeiou
2852+
code: http://example.com/aeiou
28302853
transaction: http://example.com/aeiou
2831-
event_index: event_index
2832-
code_hash: code_hash
28332854
transaction: null
28342855
ContractDeploymentsResponse:
28352856
required:
@@ -2850,29 +2871,33 @@ components:
28502871
_links:
28512872
_self: _self
28522873
contract_id: contract_id
2853-
is_placeholder: true
28542874
block_height: block_height
2875+
event_index: event_index
2876+
code_hash: code_hash
2877+
result: null
2878+
is_placeholder: true
28552879
tx_index: tx_index
28562880
_expandable:
28572881
result: http://example.com/aeiou
2882+
code: http://example.com/aeiou
28582883
transaction: http://example.com/aeiou
2859-
event_index: event_index
2860-
code_hash: code_hash
28612884
transaction: null
28622885
- transaction_id: null
28632886
address: null
28642887
code: ""
28652888
_links:
28662889
_self: _self
28672890
contract_id: contract_id
2868-
is_placeholder: true
28692891
block_height: block_height
2892+
event_index: event_index
2893+
code_hash: code_hash
2894+
result: null
2895+
is_placeholder: true
28702896
tx_index: tx_index
28712897
_expandable:
28722898
result: http://example.com/aeiou
2899+
code: http://example.com/aeiou
28732900
transaction: http://example.com/aeiou
2874-
event_index: event_index
2875-
code_hash: code_hash
28762901
transaction: null
28772902
next_cursor: next_cursor
28782903
Error:
@@ -2938,6 +2963,10 @@ components:
29382963
ContractDeployment__expandable:
29392964
type: object
29402965
properties:
2966+
code:
2967+
type: string
2968+
description: Link to fetch the Cadence source code of this deployment.
2969+
format: uri
29412970
transaction:
29422971
type: string
29432972
description: Link to fetch the full transaction that applied this deployment.
@@ -2951,6 +2980,7 @@ components:
29512980
\ and is removed from `_expandable`."
29522981
example:
29532982
result: http://example.com/aeiou
2983+
code: http://example.com/aeiou
29542984
transaction: http://example.com/aeiou
29552985
parameters:
29562986
cursorParam:

openapi/experimental/go-client-generated/docs/ContractDeployment.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,11 @@ Name | Type | Description | Notes
99
**TransactionId** | **string** | | [optional] [default to null]
1010
**TxIndex** | **string** | Position of the deploying transaction within its block. | [optional] [default to null]
1111
**EventIndex** | **string** | Position of the contract event within its transaction. | [optional] [default to null]
12-
**Code** | **string** | Base64-encoded Cadence source code of the contract deployed. | [default to null]
12+
**Code** | **string** | Base64-encoded Cadence source code of the contract deployed. | [optional] [default to null]
1313
**CodeHash** | **string** | Hex-encoded SHA3-256 hash of the contract code. | [default to null]
1414
**IsPlaceholder** | **bool** | True if the deployment was created during bootstrapping based on the current chain state, not based on a protocol event. When true, block_height, transaction_id, tx_index, and event_index are absent. | [optional] [default to null]
1515
**Transaction** | [***Transaction**](Transaction.md) | | [optional] [default to null]
16+
**Result** | [***TransactionResult**](TransactionResult.md) | | [optional] [default to null]
1617
**Expandable** | [***ContractDeploymentExpandable**](ContractDeployment__expandable.md) | | [default to null]
1718
**Links** | [***Links**](Links.md) | | [optional] [default to null]
1819

openapi/experimental/go-client-generated/docs/ContractDeploymentExpandable.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
## Properties
44
Name | Type | Description | Notes
55
------------ | ------------- | ------------- | -------------
6+
**Code** | **string** | Link to fetch the Cadence source code of this deployment. | [optional] [default to null]
67
**Transaction** | **string** | Link to fetch the full transaction that applied this deployment. | [optional] [default to null]
78
**Result** | **string** | Link to fetch the transaction result. | [optional] [default to null]
89

openapi/experimental/go-client-generated/docs/ScheduledTransaction.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ Name | Type | Description | Notes
1818
**CreatedTransactionId** | **string** | | [default to null]
1919
**ExecutedTransactionId** | **string** | | [optional] [default to null]
2020
**CancelledTransactionId** | **string** | | [optional] [default to null]
21+
**IsPlaceholder** | **bool** | True if the scheduled transaction was created during bootstrapping based on the current chain state, not based on a protocol event. When true, block_height, transaction_id, tx_index, and event_index are absent. | [optional] [default to null]
2122
**Transaction** | [***Transaction**](Transaction.md) | | [optional] [default to null]
2223
**Result** | [***TransactionResult**](TransactionResult.md) | | [optional] [default to null]
2324
**HandlerContract** | [***ContractDeployment**](ContractDeployment.md) | | [optional] [default to null]

openapi/experimental/go-client-generated/model_contract_deployment.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,13 @@ type ContractDeployment struct {
1919
// Position of the contract event within its transaction.
2020
EventIndex string `json:"event_index,omitempty"`
2121
// Base64-encoded Cadence source code of the contract deployed.
22-
Code string `json:"code"`
22+
Code string `json:"code,omitempty"`
2323
// Hex-encoded SHA3-256 hash of the contract code.
2424
CodeHash string `json:"code_hash"`
2525
// True if the deployment was created during bootstrapping based on the current chain state, not based on a protocol event. When true, block_height, transaction_id, tx_index, and event_index are absent.
2626
IsPlaceholder bool `json:"is_placeholder,omitempty"`
2727
Transaction *Transaction `json:"transaction,omitempty"`
28+
Result *TransactionResult `json:"result,omitempty"`
2829
Expandable *ContractDeploymentExpandable `json:"_expandable"`
2930
Links *Links `json:"_links,omitempty"`
3031
}

openapi/experimental/go-client-generated/model_contract_deployment__expandable.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ package swagger
1010

1111
// Contains URI links for fields not included in the response. When a field is expanded via the `expand` query parameter, it appears inline and is removed from `_expandable`.
1212
type ContractDeploymentExpandable struct {
13+
// Link to fetch the Cadence source code of this deployment.
14+
Code string `json:"code,omitempty"`
1315
// Link to fetch the full transaction that applied this deployment.
1416
Transaction string `json:"transaction,omitempty"`
1517
// Link to fetch the transaction result.

openapi/experimental/go-client-generated/model_scheduled_transaction.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ type ScheduledTransaction struct {
3333
CreatedTransactionId string `json:"created_transaction_id"`
3434
ExecutedTransactionId string `json:"executed_transaction_id,omitempty"`
3535
CancelledTransactionId string `json:"cancelled_transaction_id,omitempty"`
36+
// True if the scheduled transaction was created during bootstrapping based on the current chain state, not based on a protocol event. When true, block_height, transaction_id, tx_index, and event_index are absent.
37+
IsPlaceholder bool `json:"is_placeholder,omitempty"`
3638
Transaction *Transaction `json:"transaction,omitempty"`
3739
Result *TransactionResult `json:"result,omitempty"`
3840
HandlerContract *ContractDeployment `json:"handler_contract,omitempty"`

openapi/experimental/openapi.yaml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1126,6 +1126,9 @@ components:
11261126
cancelled_transaction_id:
11271127
description: Flow transaction ID of the cancellation transaction.
11281128
$ref: "#/components/schemas/Identifier"
1129+
is_placeholder:
1130+
description: True if the scheduled transaction was created during bootstrapping based on the current chain state, not based on a protocol event. When true, block_height, transaction_id, tx_index, and event_index are absent.
1131+
type: boolean
11291132
transaction:
11301133
$ref: "#/components/schemas/Transaction"
11311134
result:
@@ -1176,7 +1179,6 @@ components:
11761179
required:
11771180
- contract_id
11781181
- address
1179-
- code
11801182
- code_hash
11811183
- _expandable
11821184
properties:
@@ -1214,10 +1216,16 @@ components:
12141216
type: boolean
12151217
transaction:
12161218
$ref: "#/components/schemas/Transaction"
1219+
result:
1220+
$ref: "#/components/schemas/TransactionResult"
12171221
_expandable:
12181222
type: object
12191223
description: Contains URI links for fields not included in the response. When a field is expanded via the `expand` query parameter, it appears inline and is removed from `_expandable`.
12201224
properties:
1225+
code:
1226+
type: string
1227+
format: uri
1228+
description: Link to fetch the Cadence source code of this deployment.
12211229
transaction:
12221230
type: string
12231231
format: uri

0 commit comments

Comments
 (0)