mirror of https://github.com/status-im/nimplay.git
Remove exception.
This commit is contained in:
parent
b43fb639fc
commit
c48725f7ef
|
@ -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 =
|
||||
|
|
|
@ -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:
|
||||
|
|
|
@ -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:
|
||||
|
|
|
@ -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"):
|
||||
|
|
Loading…
Reference in New Issue