fix block 1149150 problem

This commit is contained in:
andri lim 2019-03-11 18:50:13 +07:00
parent 299d88d3f9
commit b1da3576ad
No known key found for this signature in database
GPG Key ID: 31702AE10541E6B9
1 changed files with 15 additions and 9 deletions

View File

@ -279,12 +279,18 @@ proc execPrecompiles*(computation: var BaseComputation): bool {.inline.} =
result = true
let precompile = PrecompileAddresses(lb)
trace "Call precompile", precompile = precompile, codeAddr = computation.msg.codeAddress
case precompile
of paEcRecover: ecRecover(computation)
of paSha256: sha256(computation)
of paRipeMd160: ripeMd160(computation)
of paIdentity: identity(computation)
of paModExp: modExp(computation)
of paEcAdd: bn256ecAdd(computation)
of paEcMul: bn256ecMul(computation)
of paPairing: bn256ecPairing(computation)
try:
case precompile
of paEcRecover: ecRecover(computation)
of paSha256: sha256(computation)
of paRipeMd160: ripeMd160(computation)
of paIdentity: identity(computation)
of paModExp: modExp(computation)
of paEcAdd: bn256ecAdd(computation)
of paEcMul: bn256ecMul(computation)
of paPairing: bn256ecPairing(computation)
except ValidationError:
# swallow any precompiles errors
debug "execPrecompiles validation error", msg=getCurrentExceptionMsg()
except ValueError:
debug "execPrecompiles value error", msg=getCurrentExceptionMsg()