Skip to content

Commit

Permalink
Add schema for new stateChanges array in simulateTransaction (also ya…
Browse files Browse the repository at this point in the history
…rn fmt:mdx?)
  • Loading branch information
Shaptic committed May 10, 2024
1 parent ea42753 commit cf21550
Show file tree
Hide file tree
Showing 7 changed files with 84 additions and 10 deletions.
2 changes: 1 addition & 1 deletion docs/smart-contracts/guides/dapps/docker.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -132,5 +132,5 @@ The `quickstart.sh` script sets up the Docker environment for running the dapp.
- Runs the `soroban-preview` container, which provides the Soroban Preview environment for development.
- Runs the `stellar/quickstart` Docker image, which sets up the Stellar network using the chosen network type and enables Soroban RPC.

[`stellar/quickstart` Docker image]: https://hub.docker.com/r/stellar/quickstart
[`stellar/quickstart` docker image]: https://hub.docker.com/r/stellar/quickstart
[example crowdfund dapp]: https://github.com/stellar/soroban-example-dapp
26 changes: 26 additions & 0 deletions openrpc/src/methods/simulateTransaction.json
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,32 @@
},
"required": [ "minResourceFee", "transactionData" ]
},
"stateChanges": {
"type": "array",
"description": "(optional) - On successful simulation of `InvokeHostFunction` operations, this field will be an array of `LedgerEntry`s before and after simulation occurred. Note that _at least_ one of `before` or `after` will be present: `before` and no `after` indicates a deletion event, the inverse is a creation event, and both present indicates an update event. Or just check the `type`.",
"items": {
"type": "object",
"properties": {
"^type$": {
"oneOf": [1, 2, 3],
"description": "Indicates if the entry was created (1), updated (2), or deleted (3)"
},
"key": {
"type": "string",
"description": "Base64 - the `LedgerEntryKey` for this delta"
},
"before": {
"type": "string",
"description": "(optional) Base64 - `LedgerEntry` state prior to simulation"
},
"after": {
"type": "string",
"description": "(optional) Base64 - `LedgerEntry` state after simulation"
}
},
"required": [ "type", "key" ]
}
},
"error": {
"type": "string",
"description": "(optional) - This field will include details about why the invoke host function call failed. Only present if the transaction simulation failed."
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ If you don't have the Vercel cli installed, run the following command to install
npm i --global vercel
```

[Vercel account]: https://vercel.com/login
[vercel account]: https://vercel.com/login

Next, you will need to remove the `target` directory to save space for the the deployment. Run the following command to remove the `target` directory:

Expand Down Expand Up @@ -329,7 +329,7 @@ You should see something like this:
]
```

[Stellar Laboratory]: https://laboratory.stellar.org/#explorer?network=futurenet
[stellar laboratory]: https://laboratory.stellar.org/#explorer?network=futurenet

## 📚 User Workflows Checklist

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ In this step, you will deploy your dapp to a hosting platform so that it can be

If you dont already have a [Vercel account], you will need to create one and link it to your GitHub account.

[Vercel account]: https://vercel.com/login
[vercel account]: https://vercel.com/login

First install the Vercel cli:

Expand Down Expand Up @@ -435,7 +435,7 @@ Don't forget to share your work with the community. Let others see what you've a

Consider customizing the code and submitting a pull request for the challenge. You can explore advanced features of the Example Soroban Payment Dapp, and Freighter wallet to take your skills to the next level. Show your creativity by adding unique functionalities, enhancing the user interface, or integrating with other APIs or services. Good luck!

[Fork the Example Soroban Payment Dapp repo]: https://github.com/stellar/soroban-react-payment
[fork the example soroban payment dapp repo]: https://github.com/stellar/soroban-react-payment

## 📚 User Workflows Checklist

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@ Once the transaction is confirmed, you should see updated balances on the fronte

Now that your dapp is fully functional, its time to deploy it to a production environment. In this step, you will learn how to deploy your dapp to Vercel, a cloud platform for static sites that offers a quick and effective way to deploy the frontend of your dapp. This section requires that you have a [Vercel account] and install the Vercel CLI.

[Vercel account]: https://vercel.com/login
[vercel account]: https://vercel.com/login

First, you will remove the target directory, as it is not used by Vercel to deploy your site. To do this, navigate to the `liquidity-pool` directory and run the following:

Expand Down Expand Up @@ -433,8 +433,8 @@ Customize the code and submit a pull request for the Liquidity Pool Dapp Challen

Take this opportunity to showcase your skills and make your mark on the Liquidity Pool Dapp. Good luck!

[Stellar Laboratory]: https://laboratory.stellar.org/#explorer?network=futurenet
[Fork the Soroban Dapps Challenge repo]: https://github.com/stellar/soroban-dapps-challenge/fork
[stellar laboratory]: https://laboratory.stellar.org/#explorer?network=futurenet
[fork the soroban dapps challenge repo]: https://github.com/stellar/soroban-dapps-challenge/fork

## 📚 User Workflows Checklist

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,7 @@ In this step, you will deploy your dapp to a hosting platform so that it can be

If you don't already have a [Vercel account], you will need to create one and link it to your GitHub account.

[Vercel account]: https://vercel.com/login
[vercel account]: https://vercel.com/login

First install the Vercel cli:

Expand Down
50 changes: 49 additions & 1 deletion static/openrpc.json
Original file line number Diff line number Diff line change
Expand Up @@ -351,6 +351,18 @@
"status": {
"type": "string",
"description": "\"healthy\""
},
"latestLedger": {
"type": "number",
"description": "Most recent known ledger sequence"
},
"oldestLedger": {
"type": "number",
"description": "Oldest ledger sequence kept in history"
},
"ledgerRetentionWindow": {
"type": "number",
"description": "Maximum retention window configured. A full window state can be determined via: ledgerRetentionWindow = latestLedger - oldestLedger + 1"
}
}
}
Expand All @@ -363,7 +375,10 @@
"result": {
"name": "getHealthResult",
"value": {
"status": "healthy"
"status": "healthy",
"latestLedger": 51583040,
"oldestLedger": 51565760,
"ledgerRetentionWindow": 17281
}
}
}
Expand Down Expand Up @@ -1117,6 +1132,39 @@
}
}
},
"stateChanges": {
"type": "array",
"description": "(optional) - On successful simulation of `InvokeHostFunction` operations, this field will be an array of `LedgerEntry`s before and after simulation occurred. Note that _at least_ one of `before` or `after` will be present: `before` and no `after` indicates a deletion event, the inverse is a creation event, and both present indicates an update event. Or just check the `type`.",
"items": {
"type": "object",
"required": [
"type",
"key"
],
"properties": {
"^type$": {
"oneOf": [
{},
{},
{}
],
"description": "Indicates if the entry was created (1), updated (2), or deleted (3)"
},
"key": {
"type": "string",
"description": "Base64 - the `LedgerEntryKey` for this delta"
},
"before": {
"type": "string",
"description": "(optional) Base64 - `LedgerEntry` state prior to simulation"
},
"after": {
"type": "string",
"description": "(optional) Base64 - `LedgerEntry` state after simulation"
}
}
}
},
"error": {
"type": "string",
"description": "(optional) - This field will include details about why the invoke host function call failed. Only present if the transaction simulation failed."
Expand Down

0 comments on commit cf21550

Please sign in to comment.