Created
June 20, 2016 20:16
-
-
Save joeykrug/9da067d8ee968f33a1186abd2d0084de to your computer and use it in GitHub Desktop.
Send log issue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from ethereum import tester as t | |
import serpent | |
| |
code1 = '''\ | |
event log_gas(gas:indexed) | |
| |
def any(): | |
log(type=log_gas, msg.gas) | |
send(0, msg.sender, msg.value)''' | |
| |
code2 = '''\ | |
{sig} | |
macro c1: 0x{addr} | |
event log_gas2(gas2:indexed) | |
| |
def any(): | |
log(type=log_gas2, msg.gas) | |
| |
def do_send(gas_amount): | |
send(gas_amount, c1, msg.value)''' | |
| |
| |
s = t.state() | |
c1 = s.abi_contract(code1) | |
code2 = code2.format(sig=serpent.mk_signature(code1), | |
addr=c1.address.encode('hex')) | |
c2 = s.abi_contract(code2) | |
s.mine(1) | |
c2.do_send(100000, value=100000000) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment