Remove exception.

This commit is contained in:
Jacques Wagener 2019-06-12 19:35:11 +02:00
parent b43fb639fc
commit c48725f7ef
No known key found for this signature in database
GPG Key ID: C294D1025DA0E923
4 changed files with 15 additions and 12 deletions

View File

@ -48,7 +48,7 @@ proc generate_method_id*(func_sig: FunctionSignature): uint32 =
# var method_str = generate_method_sig(func_sig)
# echo method_str
# return keccak_256.digest(method_str).data
return parseHexInt(getKHash(generate_method_sig(func_sig))[0..4])
return parseHexInt(getKHash(generate_method_sig(func_sig))[0..4]).uint32
proc generate_function_signature*(proc_def: NimNode): FunctionSignature =

View File

@ -25,7 +25,8 @@ proc handleContractInterface(stmts: NimNode): NimNode =
function_signatures.add(generate_function_signature(child))
out_stmts.add(child)
else:
raise newException(ParserError, "Invalid stmt \"" & treeRepr(child) & "\" not supported in contract block")
discard
# raise newException(ParserError, ">> Invalid stmt \"" & treeRepr(child) & "\" not supported in contract block")
echo "Function Signatures:"
for f in function_signatures:

View File

@ -1,8 +1,9 @@
--os:standalone
--cpu:i386
--cc:clang
--gc:regions
--gc:none
--nomain
# --d:weirdTarget
let llBin = getEnv("WASM_LLVM_BIN")
if llBin.len == 0:

View File

@ -5,19 +5,20 @@ import macros
import stint
contract("MyContract"):
expandMacros:
contract("MyContract"):
func addition(a: uint256, b: uint256): uint256 =
return a + b
func addition(a: uint256, b: uint256): uint256 =
return a + b
proc hello(): uint256 =
return (123).stuint(256)
proc hello(): uint256 =
return (123).stuint(256)
proc hellonone() =
discard
proc hellonone() =
discard
proc addition(a: uint256, b: uint256): uint256 =
return a + b
proc addition(a: uint256, b: uint256): uint256 =
return a + b
# contract("MyContract"):