cancel nio noisy messages

This commit is contained in:
romanman 2014-06-03 19:38:12 +03:00
commit da62dfd514
7 changed files with 40 additions and 50 deletions

View File

@ -38,7 +38,7 @@ public class ProgramPlayDialog extends JPanel implements ActionListener, ChangeL
program.addListener(this);
program.fullTrace();
while(!program.isStoped())
while(!program.isStopped())
vm.step(program);
setLayout(new BoxLayout(this, BoxLayout.PAGE_AXIS));

View File

@ -1,14 +1,11 @@
package org.ethereum.vm;
import com.fasterxml.jackson.databind.ser.std.ArraySerializerBase;
import org.spongycastle.util.Arrays;
import org.spongycastle.util.encoders.Hex;
import java.math.BigInteger;
import java.nio.ByteBuffer;
import static java.util.Arrays.*;
/**
* www.ethereumJ.com
* User: Roman Mandeleil

View File

@ -1,11 +1,8 @@
package org.ethereum.vm;
import com.google.api.client.util.ByteStreams;
import io.netty.buffer.UnpooledDirectByteBuf;
import org.ethereum.util.Utils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.spongycastle.util.encoders.Hex;
import java.math.BigInteger;
import java.nio.ByteBuffer;
@ -73,7 +70,7 @@ public class Program {
this.pc = pc;
}
public boolean isStoped(){
public boolean isStopped(){
return stopped;
}

View File

@ -21,7 +21,7 @@ public class VM {
Logger logger = LoggerFactory.getLogger("VM");
public void step(Program program){
public void step(Program program) {
try {
@ -29,7 +29,7 @@ public class VM {
byte op = program.getCurrentOp();
logger.debug("Op: {}" ,OpCode.code(op).name());
switch (OpCode.code(op)){
switch (OpCode.code(op)) {
/**
@ -37,7 +37,6 @@ public class VM {
*/
case STOP:{
program.setHReturn(ByteBuffer.allocate(0));
program.stop();
}
@ -98,7 +97,8 @@ public class VM {
word1.negate();
program.stackPush(word1);
program.step();
}break;
}
break;
case LT:{
DataWord word1 = program.stackPop();
DataWord word2 = program.stackPop();
@ -110,7 +110,8 @@ public class VM {
}
program.stackPush(word1);
program.step();
}break;
}
break;
case SLT:
break;
case SGT:
@ -191,9 +192,9 @@ public class VM {
word2.and(DataWord.ZERO);
word2.getData()[31] = tmp;
result = word2;
} else
} else {
result = new DataWord();
}
program.stackPush(result);
program.step();
}
@ -332,7 +333,6 @@ public class VM {
case SWAP:{
DataWord word_1 = program.stackPop();
DataWord word_2 = program.stackPop();
program.stackPush(word_1);
program.stackPush(word_2);
program.step();
@ -348,7 +348,6 @@ public class VM {
case MSTORE:{
DataWord addr = program.stackPop();
DataWord value = program.stackPop();
program.memorySave(addr, value);
program.step();
}
@ -365,8 +364,7 @@ public class VM {
case SLOAD:{
DataWord key = program.stackPop();
DataWord val = program.storageLoad(key);
if (val == null){
if (val == null) {
val = key.and(DataWord.ZERO);
}
program.stackPush(val);
@ -400,7 +398,6 @@ public class VM {
case PC:{
int pc = program.getPC();
DataWord pcWord = new DataWord(pc);
program.stackPush(pcWord);
program.step();
}

View File

@ -10,5 +10,5 @@ log4j.appender.stdout.layout.ConversionPattern= %d{HH:mm:ss} [%c{1}] %m%n
# filter noisy classes
log4j.logger.org.ethereum.net.peerdiscovery = WARN
log4j.logger.java.nio = WARN
log4j.logger.io.netty = WARN
log4j.logger.io.netty = FATAL
log4j.logger.org.ethereum.vm = DEBUG

View File

@ -16,8 +16,8 @@ peer.discovery.port = 30303
# that is the peer through
# we get the chain: [54.201.28.117] port: [30303]
# ZeroGox
peer.active.ip = 54.204.10.41
peer.active.port = 30303
#peer.active.ip = 54.204.10.41
#peer.active.port = 30303
# Some dude in Canada
#peer.active.ip = 131.104.247.135
@ -28,8 +28,8 @@ peer.active.port = 30303
#peer.active.port = 30303
# RomanJ
# peer.active.ip = 54.211.14.10
# peer.active.port = 40404
peer.active.ip = 54.211.14.10
peer.active.port = 50505
#peer.active.ip = 151.64.223.120
#peer.active.port = 30304

View File

@ -1,6 +1,5 @@
package org.ethereum.vm;
import org.junit.Assert;
import org.junit.Test;
import org.spongycastle.util.encoders.Hex;
@ -444,7 +443,7 @@ public class VMTest {
program.fullTrace();
vm.step(program);
} catch (RuntimeException e) {
assertTrue(program.isStoped());
assertTrue(program.isStopped());
return;
}
fail();
@ -460,7 +459,7 @@ public class VMTest {
program.fullTrace();
vm.step(program);
} catch (RuntimeException e) {
assertTrue(program.isStoped());
assertTrue(program.isStopped());
return;
}
fail();
@ -504,7 +503,7 @@ public class VMTest {
vm.step(program);
vm.step(program);
} catch (RuntimeException e) {
assertTrue(program.isStoped());
assertTrue(program.isStopped());
return;
}
fail();
@ -548,7 +547,7 @@ public class VMTest {
vm.step(program);
vm.step(program);
} catch (RuntimeException e) {
assertTrue(program.isStoped());
assertTrue(program.isStopped());
return;
}
fail();
@ -593,7 +592,7 @@ public class VMTest {
vm.step(program);
vm.step(program);
} catch (RuntimeException e) {
assertTrue(program.isStoped());
assertTrue(program.isStopped());
return;
}
fail();
@ -653,7 +652,7 @@ public class VMTest {
vm.step(program);
vm.step(program);
} catch (RuntimeException e) {
assertTrue(program.isStoped());
assertTrue(program.isStopped());
return;
}
fail();
@ -695,7 +694,7 @@ public class VMTest {
vm.step(program);
vm.step(program);
} catch (RuntimeException e) {
assertTrue(program.isStoped());
assertTrue(program.isStopped());
return;
}
fail();
@ -753,7 +752,7 @@ public class VMTest {
vm.step(program);
vm.step(program);
} catch (RuntimeException e) {
assertTrue(program.isStoped());
assertTrue(program.isStopped());
return;
}
fail();
@ -811,7 +810,7 @@ public class VMTest {
vm.step(program);
vm.step(program);
} catch (RuntimeException e) {
assertTrue(program.isStoped());
assertTrue(program.isStopped());
return;
}
fail();
@ -870,7 +869,7 @@ public class VMTest {
vm.step(program);
vm.step(program);
} catch (RuntimeException e) {
assertTrue(program.isStoped());
assertTrue(program.isStopped());
return;
}
fail();
@ -978,7 +977,7 @@ public class VMTest {
vm.step(program);
vm.step(program);
} catch (RuntimeException e) {
assertTrue(program.isStoped());
assertTrue(program.isStopped());
return;
}
fail();
@ -1011,7 +1010,7 @@ public class VMTest {
vm.step(program);
vm.step(program);
} catch (RuntimeException e) {
assertTrue(program.isStoped());
assertTrue(program.isStopped());
return;
}
fail();
@ -1236,7 +1235,7 @@ public class VMTest {
try {
vm.step(program);
} catch (RuntimeException e) {
assertTrue(program.isStoped());
assertTrue(program.isStopped());
return;
}
fail();
@ -1296,7 +1295,7 @@ public class VMTest {
vm.step(program);
vm.step(program);
} catch (RuntimeException e) {
assertTrue(program.isStoped());
assertTrue(program.isStopped());
return;
}
fail();
@ -1487,7 +1486,7 @@ public class VMTest {
vm.step(program);
vm.step(program);
} catch (RuntimeException e) {
assertTrue(program.isStoped());
assertTrue(program.isStopped());
return;
}
fail();
@ -1540,7 +1539,7 @@ public class VMTest {
vm.step(program);
vm.step(program);
} catch (RuntimeException e) {
assertTrue(program.isStoped());
assertTrue(program.isStopped());
return;
}
fail();
@ -1615,7 +1614,7 @@ public class VMTest {
vm.step(program);
vm.step(program);
} catch (RuntimeException e) {
assertTrue(program.isStoped());
assertTrue(program.isStopped());
return;
}
fail();
@ -1676,7 +1675,7 @@ public class VMTest {
vm.step(program);
vm.step(program);
} catch (RuntimeException e) {
assertTrue(program.isStoped());
assertTrue(program.isStopped());
return;
}
fail();
@ -1829,7 +1828,7 @@ public class VMTest {
vm.step(program);
vm.step(program);
} catch (RuntimeException e) {
assertTrue(program.isStoped());
assertTrue(program.isStopped());
return;
}
fail();
@ -1923,7 +1922,7 @@ public class VMTest {
vm.step(program);
vm.step(program);
} catch (RuntimeException e) {
assertTrue(program.isStoped());
assertTrue(program.isStopped());
return;
}
fail();
@ -2054,7 +2053,7 @@ public class VMTest {
vm.step(program);
vm.step(program);
assertTrue(program.isStoped());
assertTrue(program.isStopped());
}
@Test // CODECOPY OP
@ -2070,7 +2069,7 @@ public class VMTest {
vm.step(program);
vm.step(program);
assertTrue(program.isStoped());
assertTrue(program.isStopped());
}
@ -2086,7 +2085,7 @@ public class VMTest {
vm.step(program);
vm.step(program);
} catch (RuntimeException e) {
assertTrue(program.isStoped());
assertTrue(program.isStopped());
return;
}
fail();
@ -2218,7 +2217,7 @@ public class VMTest {
try {
vm.step(program);
} catch (RuntimeException e) {
assertTrue(program.isStoped());
assertTrue(program.isStopped());
return;
}
fail();