We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
class https://github.com/ethereum/ethereumj/blob/develop/ethereumj-core/src/main/java/org/ethereum/vm/DataWord.java static ONE is null, bug in line 81;
public static final DataWord ONE = DataWord.of((byte) 1); public static DataWord of(int num) { return of(intToBytes(num)); } public static DataWord of(byte[] data) { if (data == null || data.length == 0) { return DataWord.ZERO; } int leadingZeroBits = numberOfLeadingZeros(data); int valueBits = 8 * data.length - leadingZeroBits; if (valueBits <= 8) { if (data[data.length - 1] == 0) { return DataWord.ZERO; } if (data[data.length - 1] == 1) { //hotfix: dataWord one is not init /* * byte[] bytes = new byte[8 * data.length]; bytes[bytes.length - 1] = 1; return new DataWord(bytes);*/ //bug:return ONE but ONE is not init,so ONE is null return DataWord.ONE ; } } if (data.length == 32) { return new DataWord(java.util.Arrays.copyOf(data, data.length)); } else if (data.length <= 32) { byte[] bytes = new byte[32]; System.arraycopy(data, 0, bytes, 32 - data.length, data.length); return new DataWord(bytes); } else { throw new RuntimeException(String.format("Data word can't exceed 32 bytes: 0x%s", ByteUtil.toHexString(data))); } }
The text was updated successfully, but these errors were encountered:
I've created test and it passes. Why do you think it's bugged?
@Test public void testOne() { byte[] input = new byte[] {0x01}; DataWord one = DataWord.of(input); assertArrayEquals(Hex.decode("0000000000000000000000000000000000000000000000000000000000000001"), one.getData()); }
Sorry, something went wrong.
@zilm13 Are you sure your source code(DataWord ) is consistent with mine?
@tangkunprimeledger mine is develop
develop
No branches or pull requests
class https://github.com/ethereum/ethereumj/blob/develop/ethereumj-core/src/main/java/org/ethereum/vm/DataWord.java static ONE is null, bug in line 81;
The text was updated successfully, but these errors were encountered: