Skip to content

Commit

Permalink
Merge pull request #2318 from jorgemmsilva/feat/waitl1confirm-waitreq
Browse files Browse the repository at this point in the history
Feat: waitl1confirm param on waitreq endpoint
  • Loading branch information
jorgemmsilva authored Apr 12, 2023
2 parents 67c29c2 + 9f81e24 commit 400ea7c
Show file tree
Hide file tree
Showing 38 changed files with 182 additions and 189 deletions.
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,13 @@ build: compile-solidity build-cli
build-lint: build lint

test-full: install
go test -tags $(BUILD_TAGS),runheavy ./... --timeout 60m --count 1 -failfast -p 1
go test -tags $(BUILD_TAGS),runheavy ./... --timeout 60m --count 1 -failfast

test: install
go test -tags $(BUILD_TAGS) $(TEST_PKG) --timeout 90m --count 1 -failfast -p 1 $(TEST_ARG)
go test -tags $(BUILD_TAGS) $(TEST_PKG) --timeout 90m --count 1 -failfast $(TEST_ARG)

test-short:
go test -tags $(BUILD_TAGS) --short --count 1 -failfast -p 1 $(shell go list ./... | grep -v github.com/iotaledger/wasp/contracts/wasm)
go test -tags $(BUILD_TAGS) --short --count 1 -failfast $(shell go list ./... | grep -v github.com/iotaledger/wasp/contracts/wasm)

install-cli:
cd tools/wasp-cli && go mod tidy && go install -ldflags $(BUILD_LD_FLAGS)
Expand Down
157 changes: 67 additions & 90 deletions clients/apiclient/api/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1381,6 +1381,12 @@ paths:
schema:
format: int32
type: integer
- description: Wait for the block to be confirmed on L1
in: query
name: waitForL1Confirmation
schema:
format: boolean
type: boolean
responses:
"200":
content:
Expand Down Expand Up @@ -1687,7 +1693,7 @@ paths:
application/json:
schema:
items:
$ref: '#/components/schemas/PeeringNodeStatusResponse__'
$ref: '#/components/schemas/PeeringNodeStatusResponse_'
type: array
description: A list of all peers
"401":
Expand Down Expand Up @@ -2538,11 +2544,11 @@ components:
id: id
senderAccount: senderAccount
isOffLedger: true
gasBudget: gasBudget
requestId: requestId
callTarget:
contractHName: contractHName
functionHName: functionHName
gasBudget: gasBudget
targetAddress: targetAddress
allowance:
nfts:
Expand Down Expand Up @@ -2593,11 +2599,11 @@ components:
id: id
senderAccount: senderAccount
isOffLedger: true
gasBudget: gasBudget
requestId: requestId
callTarget:
contractHName: contractHName
functionHName: functionHName
gasBudget: gasBudget
targetAddress: targetAddress
allowance:
nfts:
Expand Down Expand Up @@ -2710,21 +2716,21 @@ components:
example:
chainOwnerId: tst1qzjsxstc0k850jevpqu08tj0suql9u7hvh3vq3eaaem3gkx7r646zqpdn6e
gasLimits:
maxGasExternalViewCall: 5
minGasPerRequest: 7
maxGasPerBlock: 5
maxGasPerRequest: 2
maxGasExternalViewCall: 6
minGasPerRequest: 5
maxGasPerBlock: 1
maxGasPerRequest: 5
chainID: tst1prcw42l5u4g24tqg628d7qzh7n6m4k4ktvgayh44dyt68y930qzy2lr054v
evmChainId: 1074
customMetadata: customMetadata
gasFeePolicy:
gasPerToken:
a: 1
b: 100
validatorFeeShare: 1
validatorFeeShare: 0
evmGasRatio:
a: 0
b: 0
a: 1
b: 1
isActive: true
properties:
chainID:
Expand Down Expand Up @@ -2924,18 +2930,18 @@ components:
committeeNodes:
- node:
isAlive: true
peeringURL: peeringURL
peeringURL: localhost:4000
name: name
publicKey: 61270151fbd8c71e43c17e0eff8c76c1ba991be28f088f72a05d790f302d67c7
numUsers: 6
publicKey: 0x0000
numUsers: 1
isTrusted: true
accessAPI: accessAPI
- node:
isAlive: true
peeringURL: peeringURL
peeringURL: localhost:4000
name: name
publicKey: 61270151fbd8c71e43c17e0eff8c76c1ba991be28f088f72a05d790f302d67c7
numUsers: 6
publicKey: 0x0000
numUsers: 1
isTrusted: true
accessAPI: accessAPI
chainId: tst1pqm5ckama06xhkl080mmvz6l3xy8c8lulrwy7mx4ll0fc69krxfgka70j0e
Expand Down Expand Up @@ -3041,10 +3047,10 @@ components:
example:
node:
isAlive: true
peeringURL: peeringURL
peeringURL: localhost:4000
name: name
publicKey: 61270151fbd8c71e43c17e0eff8c76c1ba991be28f088f72a05d790f302d67c7
numUsers: 6
publicKey: 0x0000
numUsers: 1
isTrusted: true
accessAPI: accessAPI
properties:
Expand Down Expand Up @@ -3561,10 +3567,10 @@ components:
gasPerToken:
a: 1
b: 100
validatorFeeShare: 1
validatorFeeShare: 0
evmGasRatio:
a: 0
b: 0
a: 1
b: 1
properties:
evmGasRatio:
$ref: '#/components/schemas/Ratio32_'
Expand All @@ -3588,15 +3594,15 @@ components:
gasPerToken:
a: 0
b: 0
validatorFeeShare: 0
validatorFeeShare: 1
evmGasRatio:
a: 0
b: 0
properties:
evmGasRatio:
$ref: '#/components/schemas/Ratio32_'
$ref: '#/components/schemas/Ratio32__'
gasPerToken:
$ref: '#/components/schemas/Ratio32_'
$ref: '#/components/schemas/Ratio32__'
validatorFeeShare:
description: The validator fee share.
format: int32
Expand Down Expand Up @@ -3656,17 +3662,17 @@ components:
example:
chainOwnerId: chainOwnerId
gasLimits:
maxGasExternalViewCall: 5
minGasPerRequest: 7
maxGasPerBlock: 5
maxGasPerRequest: 2
maxGasExternalViewCall: 6
minGasPerRequest: 5
maxGasPerBlock: 1
maxGasPerRequest: 5
chainID: chainID
customMetadata: customMetadata
gasFeePolicy:
gasPerToken:
a: 0
b: 0
validatorFeeShare: 0
validatorFeeShare: 1
evmGasRatio:
a: 0
b: 0
Expand Down Expand Up @@ -4029,10 +4035,10 @@ components:
name: L1Params
Limits:
example:
maxGasExternalViewCall: 5
minGasPerRequest: 7
maxGasPerBlock: 5
maxGasPerRequest: 2
maxGasExternalViewCall: 6
minGasPerRequest: 5
maxGasPerBlock: 1
maxGasPerRequest: 5
properties:
maxGasExternalViewCall:
description: The maximum gas per external view call
Expand Down Expand Up @@ -4623,60 +4629,6 @@ components:
xml:
name: PeeringNodeStatusResponse
PeeringNodeStatusResponse_:
example:
isAlive: true
peeringURL: peeringURL
name: name
publicKey: 61270151fbd8c71e43c17e0eff8c76c1ba991be28f088f72a05d790f302d67c7
numUsers: 6
isTrusted: true
properties:
isAlive:
description: Whether or not the peer is activated
format: boolean
type: boolean
xml:
name: IsAlive
isTrusted:
format: boolean
type: boolean
xml:
name: IsTrusted
name:
format: string
type: string
xml:
name: Name
numUsers:
description: The amount of users attached to the peer
format: int32
type: integer
xml:
name: NumUsers
peeringURL:
description: The peering URL of the peer
format: string
type: string
xml:
name: PeeringURL
publicKey:
description: The peers public key encoded in Hex
example: 61270151fbd8c71e43c17e0eff8c76c1ba991be28f088f72a05d790f302d67c7
format: string
type: string
xml:
name: PublicKey
required:
- isAlive
- isTrusted
- name
- numUsers
- peeringURL
- publicKey
type: object
xml:
name: PeeringNodeStatusResponse
PeeringNodeStatusResponse__:
example:
isAlive: true
peeringURL: localhost:4000
Expand Down Expand Up @@ -4889,6 +4841,31 @@ components:
xml:
name: Ratio32
Ratio32_:
example:
a: 1
b: 1
properties:
a:
example: 1
format: int32
minimum: 0
type: integer
xml:
name: A
b:
example: 1
format: int32
minimum: 0
type: integer
xml:
name: B
required:
- a
- b
type: object
xml:
name: Ratio32
Ratio32__:
example:
a: 0
b: 0
Expand Down Expand Up @@ -5096,11 +5073,11 @@ components:
id: id
senderAccount: senderAccount
isOffLedger: true
gasBudget: gasBudget
requestId: requestId
callTarget:
contractHName: contractHName
functionHName: functionHName
gasBudget: gasBudget
targetAddress: targetAddress
allowance:
nfts:
Expand Down Expand Up @@ -5264,11 +5241,11 @@ components:
id: id
senderAccount: senderAccount
isOffLedger: true
gasBudget: gasBudget
requestId: requestId
callTarget:
contractHName: contractHName
functionHName: functionHName
gasBudget: gasBudget
targetAddress: targetAddress
allowance:
nfts:
Expand Down
10 changes: 10 additions & 0 deletions clients/apiclient/api_requests.go

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

6 changes: 4 additions & 2 deletions clients/apiclient/docs/RequestsApi.md
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ No authorization required

## WaitForRequest

> ReceiptResponse WaitForRequest(ctx, chainID, requestID).TimeoutSeconds(timeoutSeconds).Execute()
> ReceiptResponse WaitForRequest(ctx, chainID, requestID).TimeoutSeconds(timeoutSeconds).WaitForL1Confirmation(waitForL1Confirmation).Execute()
Wait until the given request has been processed by the node

Expand All @@ -232,10 +232,11 @@ func main() {
chainID := "chainID_example" // string | ChainID (Bech32)
requestID := "requestID_example" // string | RequestID (Hex)
timeoutSeconds := int32(56) // int32 | The timeout in seconds (optional)
waitForL1Confirmation := true // bool | Wait for the block to be confirmed on L1 (optional)

configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.RequestsApi.WaitForRequest(context.Background(), chainID, requestID).TimeoutSeconds(timeoutSeconds).Execute()
resp, r, err := apiClient.RequestsApi.WaitForRequest(context.Background(), chainID, requestID).TimeoutSeconds(timeoutSeconds).WaitForL1Confirmation(waitForL1Confirmation).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `RequestsApi.WaitForRequest``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
Expand Down Expand Up @@ -264,6 +265,7 @@ Name | Type | Description | Notes


**timeoutSeconds** | **int32** | The timeout in seconds |
**waitForL1Confirmation** | **bool** | Wait for the block to be confirmed on L1 |

### Return type

Expand Down
Loading

0 comments on commit 400ea7c

Please sign in to comment.