diff options
author | obscuren <geffobscura@gmail.com> | 2014-10-14 19:37:26 +0800 |
---|---|---|
committer | obscuren <geffobscura@gmail.com> | 2014-10-14 19:37:26 +0800 |
commit | f55e39cf1ae138f7698d8dce3aeee5eaa3f87a7d (patch) | |
tree | 9ac63476eec450a8b9ecb261f07b91cdeea2a7c4 /ethvm/execution.go | |
parent | 393a92811bd810e33cf1e0b281f9fefa09643cd2 (diff) | |
download | go-tangerine-f55e39cf1ae138f7698d8dce3aeee5eaa3f87a7d.tar go-tangerine-f55e39cf1ae138f7698d8dce3aeee5eaa3f87a7d.tar.gz go-tangerine-f55e39cf1ae138f7698d8dce3aeee5eaa3f87a7d.tar.bz2 go-tangerine-f55e39cf1ae138f7698d8dce3aeee5eaa3f87a7d.tar.lz go-tangerine-f55e39cf1ae138f7698d8dce3aeee5eaa3f87a7d.tar.xz go-tangerine-f55e39cf1ae138f7698d8dce3aeee5eaa3f87a7d.tar.zst go-tangerine-f55e39cf1ae138f7698d8dce3aeee5eaa3f87a7d.zip |
Tests for native function calling
Diffstat (limited to 'ethvm/execution.go')
-rw-r--r-- | ethvm/execution.go | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/ethvm/execution.go b/ethvm/execution.go index 84bc50778..6273fc49e 100644 --- a/ethvm/execution.go +++ b/ethvm/execution.go @@ -50,9 +50,11 @@ func (self *Execution) Exec(codeAddr []byte, caller ClosureRef) (ret []byte, err stateObject.AddAmount(self.value) // Precompiled contracts (address.go) 1, 2 & 3. - if p := Precompiled[ethutil.BigD(codeAddr).Uint64()]; p != nil { + naddr := ethutil.BigD(codeAddr).Uint64() + if p := Precompiled[naddr]; p != nil { if self.gas.Cmp(p.Gas) >= 0 { ret = p.Call(self.input) + self.vm.Printf("NATIVE_FUNC(%x) => %x", naddr, ret) } } else { if self.vm.Depth() == MaxCallDepth { |