Skip to content

Commit

Permalink
wrap SmartWeave methods exposed to rust with exception handling code
Browse files Browse the repository at this point in the history
  • Loading branch information
rpiszczatowski committed Feb 11, 2023
1 parent 3493ed6 commit 59d613e
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions src/core/modules/impl/wasm/rust-wasm-imports.ts
Original file line number Diff line number Diff line change
Expand Up @@ -134,12 +134,16 @@ export const rustWasmImports = (swGlobal, wbindgenImports, wasmInstance, dtorVal
}, arguments);
},
__wbg_readContractState: function (arg0, arg1) {
var ret = rawImports.SmartWeave.readContractState(getStringFromWasm0(arg0, arg1));
return addHeapObject(ret);
return handleError(function (arg0, arg1) {
var ret = rawImports.SmartWeave.readContractState(getStringFromWasm0(arg0, arg1));
return addHeapObject(ret);
}, arguments)
},
__wbg_viewContractState: function (arg0, arg1, arg2) {
var ret = rawImports.SmartWeave.viewContractState(getStringFromWasm0(arg0, arg1), takeObject(arg2));
return addHeapObject(ret);
return handleError(function (arg0, arg1, arg2) {
var ret = rawImports.SmartWeave.viewContractState(getStringFromWasm0(arg0, arg1), takeObject(arg2));
return addHeapObject(ret);
}, arguments)
},
__wbg_caller: function (arg0) {
var ret = rawImports.SmartWeave.caller();
Expand All @@ -153,8 +157,10 @@ export const rustWasmImports = (swGlobal, wbindgenImports, wasmInstance, dtorVal
getInt32Memory0()[arg0 / 4 + 0] = ptr0;
},
__wbg_write: function (arg0, arg1, arg2) {
var ret = rawImports.SmartWeave.write(getStringFromWasm0(arg0, arg1), takeObject(arg2));
return addHeapObject(ret);
return handleError(function (arg0, arg1, arg2) {
var ret = rawImports.SmartWeave.write(getStringFromWasm0(arg0, arg1), takeObject(arg2));
return addHeapObject(ret);
}, arguments)
},
__wbg_refreshState: function (arg0, arg1) {
// TODO
Expand Down

0 comments on commit 59d613e

Please sign in to comment.