Skip to content

Commit

Permalink
Update changeLog
Browse files Browse the repository at this point in the history
  • Loading branch information
DOBEN committed Feb 23, 2024
1 parent 0395270 commit 7f74dc0
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 5 deletions.
4 changes: 4 additions & 0 deletions front-end-tools/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 3.1.1

- Add decoding of a failed invoke transaction into a human-readable error.

## 3.1.0

- Add option to `deriveFromChain` given a module reference in Step 2.
Expand Down
2 changes: 1 addition & 1 deletion front-end-tools/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "front-end-tools",
"packageManager": "yarn@4.0.2",
"version": "3.1.0",
"version": "3.1.1",
"license": "Apache-2.0",
"engines": {
"node": ">=16.x"
Expand Down
2 changes: 1 addition & 1 deletion front-end-tools/src/components/InitComponent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -726,7 +726,7 @@ export default function InitComponent(props: ConnectionProps) {
)}
{smartContractIndex !== undefined && (
<div className="actionResultBox">
Smart Contract Inedex:
Smart Contract Index:
<div>{smartContractIndex}</div>
</div>
)}
Expand Down
6 changes: 3 additions & 3 deletions front-end-tools/src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@ export function getArrayExample(template: string | undefined) {
* @param failedResult the failed invoke contract result.
* @param contractName the name of the contract.
* @param entryPoint the entry point name.
* @param moduleSchema an optional module schema. If provided, the rejectReason code as logged by the smart contract can be decoded into a human-readable error string.
* @param moduleSchema an optional module schema including an error schema. If provided, the rejectReason code as logged by the smart contract can be decoded into a human-readable error string.
*
* @returns a decoded human-readable reject reason string (falls back to return the error codes if a missing schema prevents the function from decoding the error codes into human-readable strings).
* @returns a decoded human-readable reject reason string (or falls back to return the error codes if decoding is impossible).
*/
export function decodeRejectReason(
failedResult: InvokeContractFailedResult,
Expand All @@ -69,7 +69,7 @@ export function decodeRejectReason(
// -3 => 0x02
// -4 => 0x03
// ...
// This conversion works as long as there ares no more then 256 (one byte) of different errors in the smart contract which should be sufficient for practical smart contracts.
// This conversion works as long as there are no more then 256 (one byte) of different errors in the smart contract which should be sufficient for practical smart contracts.
const decodedError = deserializeReceiveError(
Uint8Array.from([Math.abs(rejectReason) - 1]).buffer,
toBuffer(moduleSchema, 'base64'),
Expand Down

0 comments on commit 7f74dc0

Please sign in to comment.