mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-27 23:26:44 +00:00
core/vm/runtime: gofmt the tests
This commit is contained in:
parent
65a6cc2f1e
commit
2320af4b9d
1 changed files with 37 additions and 37 deletions
|
|
@ -172,45 +172,45 @@ func TestTransactionReverted(t *testing.T) {
|
||||||
|
|
||||||
func TestDelegateReverted(t *testing.T) {
|
func TestDelegateReverted(t *testing.T) {
|
||||||
/*
|
/*
|
||||||
Contract Source Code
|
Contract Source Code
|
||||||
```
|
```
|
||||||
contract Relay {
|
contract Relay {
|
||||||
address public currentVersion;
|
address public currentVersion;
|
||||||
address public owner;
|
address public owner;
|
||||||
|
|
||||||
modifier onlyOwner() {
|
modifier onlyOwner() {
|
||||||
if (msg.sender != owner) {
|
if (msg.sender != owner) {
|
||||||
throw;
|
throw;
|
||||||
}
|
}
|
||||||
_;
|
_;
|
||||||
}
|
}
|
||||||
function Relay(address _address) {
|
function Relay(address _address) {
|
||||||
currentVersion = _address;
|
currentVersion = _address;
|
||||||
owner = msg.sender;
|
owner = msg.sender;
|
||||||
}
|
}
|
||||||
function changeContract(address newVersion) public
|
function changeContract(address newVersion) public
|
||||||
onlyOwner()
|
onlyOwner()
|
||||||
{
|
{
|
||||||
currentVersion = newVersion;
|
currentVersion = newVersion;
|
||||||
}
|
}
|
||||||
function() {
|
function() {
|
||||||
if(!currentVersion.delegatecall(msg.data)) throw;
|
if(!currentVersion.delegatecall(msg.data)) throw;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
contract Demo {
|
contract Demo {
|
||||||
function Demo() {
|
function Demo() {
|
||||||
}
|
}
|
||||||
function IllegalDivision() returns(int) {
|
function IllegalDivision() returns(int) {
|
||||||
var dividend = 0;
|
var dividend = 0;
|
||||||
return 1 / dividend;
|
return 1 / dividend;
|
||||||
}
|
}
|
||||||
function LegalDivision() returns(int) {
|
function LegalDivision() returns(int) {
|
||||||
var dividend = 1;
|
var dividend = 1;
|
||||||
return 1 / dividend;
|
return 1 / dividend;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
*/
|
*/
|
||||||
var definition = `[{"constant":false,"inputs":[],"name":"LegalDivision","outputs":[{"name":"","type":"int256"}],"payable":false,"type":"function"},{"constant":false,"inputs":[],"name":"IllegalDivision","outputs":[{"name":"","type":"int256"}],"payable":false,"type":"function"},{"inputs":[],"payable":false,"type":"constructor"}]`
|
var definition = `[{"constant":false,"inputs":[],"name":"LegalDivision","outputs":[{"name":"","type":"int256"}],"payable":false,"type":"function"},{"constant":false,"inputs":[],"name":"IllegalDivision","outputs":[{"name":"","type":"int256"}],"payable":false,"type":"function"},{"inputs":[],"payable":false,"type":"constructor"}]`
|
||||||
var rawcode1 = common.Hex2Bytes("6060604052341561000c57fe5b5b5b5b60f88061001d6000396000f30060606040526000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff1680632d256662146044578063522de105146067575bfe5b3415604b57fe5b6051608a565b6040518082815260200191505060405180910390f35b3415606e57fe5b607460ab565b6040518082815260200191505060405180910390f35b60006000600190508060ff16600181151560a057fe5b0460ff1691505b5090565b60006000600090508060ff16600181151560c157fe5b0460ff1691505b50905600a165627a7a7230582091585859014c4644d0427bf34abc65433b5874993ddea00cac57bcb87ee4cb6b0029")
|
var rawcode1 = common.Hex2Bytes("6060604052341561000c57fe5b5b5b5b60f88061001d6000396000f30060606040526000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff1680632d256662146044578063522de105146067575bfe5b3415604b57fe5b6051608a565b6040518082815260200191505060405180910390f35b3415606e57fe5b607460ab565b6040518082815260200191505060405180910390f35b60006000600190508060ff16600181151560a057fe5b0460ff1691505b5090565b60006000600090508060ff16600181151560c157fe5b0460ff1691505b50905600a165627a7a7230582091585859014c4644d0427bf34abc65433b5874993ddea00cac57bcb87ee4cb6b0029")
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue