aboutsummaryrefslogtreecommitdiffstats
path: root/tests/util.go
diff options
context:
space:
mode:
authorGustav Simonsson <gustav.simonsson@gmail.com>2015-11-27 22:40:29 +0800
committerJeffrey Wilcke <geffobscura@gmail.com>2016-02-18 17:08:11 +0800
commit371871d685d54b916aef28de689d6f0af7822083 (patch)
treee704b02ba2ffd2d1164001885fba15106b0f7d94 /tests/util.go
parentaa36a6ae4f24f07e2c470a21c93ff37ad5861982 (diff)
downloaddexon-371871d685d54b916aef28de689d6f0af7822083.tar.gz
dexon-371871d685d54b916aef28de689d6f0af7822083.tar.zst
dexon-371871d685d54b916aef28de689d6f0af7822083.zip
parmas, crypto, core, core/vm: homestead consensus protocol changes
* change gas cost for contract creating txs * invalidate signature with s value greater than secp256k1 N / 2 * OOG contract creation if not enough gas to store code * new difficulty adjustment algorithm * new DELEGATECALL op code
Diffstat (limited to 'tests/util.go')
-rw-r--r--tests/util.go26
1 files changed, 18 insertions, 8 deletions
diff --git a/tests/util.go b/tests/util.go
index 571161683..8196d7fd6 100644
--- a/tests/util.go
+++ b/tests/util.go
@@ -235,6 +235,15 @@ func (self *Env) CallCode(caller vm.ContractRef, addr common.Address, data []byt
return core.CallCode(self, caller, addr, data, gas, price, value)
}
+func (self *Env) DelegateCall(caller vm.ContractRef, addr common.Address, data []byte, gas, price *big.Int) ([]byte, error) {
+ if self.vmTest && self.depth > 0 {
+ caller.ReturnGas(gas, price)
+
+ return nil, nil
+ }
+ return core.DelegateCall(self, caller, addr, data, gas, price)
+}
+
func (self *Env) Create(caller vm.ContractRef, data []byte, gas, price, value *big.Int) ([]byte, common.Address, error) {
if self.vmTest {
caller.ReturnGas(gas, price)
@@ -260,11 +269,12 @@ func NewMessage(from common.Address, to *common.Address, data []byte, value, gas
return Message{from, to, value, gas, price, data, nonce}
}
-func (self Message) Hash() []byte { return nil }
-func (self Message) From() (common.Address, error) { return self.from, nil }
-func (self Message) To() *common.Address { return self.to }
-func (self Message) GasPrice() *big.Int { return self.price }
-func (self Message) Gas() *big.Int { return self.gas }
-func (self Message) Value() *big.Int { return self.value }
-func (self Message) Nonce() uint64 { return self.nonce }
-func (self Message) Data() []byte { return self.data }
+func (self Message) Hash() []byte { return nil }
+func (self Message) From() (common.Address, error) { return self.from, nil }
+func (self Message) FromFrontier() (common.Address, error) { return self.from, nil }
+func (self Message) To() *common.Address { return self.to }
+func (self Message) GasPrice() *big.Int { return self.price }
+func (self Message) Gas() *big.Int { return self.gas }
+func (self Message) Value() *big.Int { return self.value }
+func (self Message) Nonce() uint64 { return self.nonce }
+func (self Message) Data() []byte { return self.data }