public boolean readBoolean() throws NulsException { byte b = readByte(); return 1 == b; }
@Override public void parse(NulsByteBuffer byteBuffer) throws NulsException { this.orginTxHash = byteBuffer.readHash(); this.contractAddress = byteBuffer.readBytes(Address.ADDRESS_LENGTH); this.success = byteBuffer.readByte(); }
@Override public void parse(NulsByteBuffer byteBuffer) throws NulsException { this.address = byteBuffer.readBytes(Address.ADDRESS_LENGTH); this.reasonCode = byteBuffer.readByte(); this.evidence = byteBuffer.readByLengthByte(); }
@Override public void parse(NulsByteBuffer byteBuffer) throws NulsException { this.signAlgType = byteBuffer.readByte(); this.signBytes = byteBuffer.readByLengthByte(); }
@Override public void parse(NulsByteBuffer byteBuffer) throws NulsException { int length = byteBuffer.readByte(); this.publicKey = byteBuffer.readBytes(length); this.signData = new NulsSignData(); this.signData.parse(byteBuffer); }
@Override public void parse(NulsByteBuffer byteBuffer) throws NulsException { digestAlgType = byteBuffer.readByte(); this.digestBytes = byteBuffer.readByLengthByte(); }
@Override public void parse(NulsByteBuffer byteBuffer) throws NulsException { int length = byteBuffer.readByte(); this.publicKey = byteBuffer.readBytes(length); this.signData = new NulsSignData(); this.signData.parse(byteBuffer); }
@Override public void parse(NulsByteBuffer byteBuffer) throws NulsException { this.type = MessageDataType.getType(byteBuffer.readByte()); this.hash = byteBuffer.readHash(); }
@Override public void parse(NulsByteBuffer byteBuffer) throws NulsException { this.sender = byteBuffer.readBytes(Address.ADDRESS_LENGTH); this.contractAddress = byteBuffer.readBytes(Address.ADDRESS_LENGTH); this.value = byteBuffer.readInt64(); this.gasLimit = byteBuffer.readInt64(); this.price = byteBuffer.readInt64(); this.methodName = byteBuffer.readString(); this.methodDesc = byteBuffer.readString(); this.argsCount = byteBuffer.readByte(); byte length = this.argsCount; this.args = new String[length][]; for(byte i = 0; i < length; i++) { byte argCount = byteBuffer.readByte(); if(argCount == 0) { args[i] = new String[0]; } else { String[] arg = new String[argCount]; for(byte k = 0; k < argCount; k++) { arg[k] = byteBuffer.readString(); } args[i] = arg; } } }
@Override public void parse(NulsByteBuffer byteBuffer) throws NulsException { this.type = byteBuffer.readByte(); this.address = byteBuffer.readBytes(Address.ADDRESS_LENGTH); this.time = byteBuffer.readUint48(); this.height = byteBuffer.readVarInt(); this.roundIndex = byteBuffer.readVarInt(); this.reasonCode = byteBuffer.readShort(); this.evidence = byteBuffer.readByLengthByte(); }
@Override public void parse(NulsByteBuffer byteBuffer) throws NulsException { this.blockHeight=byteBuffer.readInt64(); this.hash=new NulsDigestData( byteBuffer.readByte(),byteBuffer.readByLengthByte()); this.preHash=new NulsDigestData( byteBuffer.readByte(),byteBuffer.readByLengthByte()); int listCount = (int) byteBuffer.readVarInt(); if (0 < listCount) { List<UtxoAccountsBalancePo> list = new ArrayList<>(); for (int i = 0; i < listCount; i++) { list.add(byteBuffer.readNulsData(new UtxoAccountsBalancePo())); } this.balanceList = list; } }
@Override public void parse(NulsByteBuffer byteBuffer) throws NulsException { this.sender = byteBuffer.readBytes(Address.ADDRESS_LENGTH); this.contractAddress = byteBuffer.readBytes(Address.ADDRESS_LENGTH); this.value = byteBuffer.readInt64(); this.codeLen = byteBuffer.readInt32(); this.code = byteBuffer.readByLengthByte(); this.gasLimit = byteBuffer.readInt64(); this.price = byteBuffer.readInt64(); this.argsCount = byteBuffer.readByte(); byte length = this.argsCount; this.args = new String[length][]; for(byte i = 0; i < length; i++) { byte argCount = byteBuffer.readByte(); if(argCount == 0) { args[i] = new String[0]; } else { String[] arg = new String[argCount]; for(byte k = 0; k < argCount; k++) { arg[k] = byteBuffer.readString(); } args[i] = arg; } } }
@Override public void parse(NulsByteBuffer byteBuffer) throws NulsException { this.txHash = byteBuffer.readHash(); this.blockHeight = byteBuffer.readUint32(); this.time = byteBuffer.readUint48(); this.addresses = byteBuffer.readByLengthByte(); this.txType = byteBuffer.readUint16(); this.status = byteBuffer.readByte(); }
@Override public void parse(NulsByteBuffer byteBuffer) throws NulsException { this.txHash = byteBuffer.readHash(); this.blockHeight = byteBuffer.readUint32(); this.time = byteBuffer.readUint48(); this.addresses = byteBuffer.readByLengthByte(); this.txType = byteBuffer.readUint16(); this.status = byteBuffer.readByte(); }
public static boolean validNormalAddress(byte[] bytes) { if (null == bytes || bytes.length != Address.ADDRESS_LENGTH) { return false; } NulsByteBuffer byteBuffer = new NulsByteBuffer(bytes); short chainId; byte type; try { chainId = byteBuffer.readShort(); type = byteBuffer.readByte(); } catch (NulsException e) { Log.error(e); return false; } if (NulsContext.getInstance().getDefaultChainId() != chainId) { return false; } if (NulsContext.DEFAULT_ADDRESS_TYPE != type) { return false; } return true; }
public static boolean validContractAddress(byte[] addressBytes) { if (addressBytes == null) { return false; } if (addressBytes.length != Address.ADDRESS_LENGTH) { return false; } NulsByteBuffer byteBuffer = new NulsByteBuffer(addressBytes); short chainId; byte type; try { chainId = byteBuffer.readShort(); type = byteBuffer.readByte(); } catch (NulsException e) { Log.error(e); return false; } if (NulsContext.getInstance().getDefaultChainId() != chainId) { return false; } if (NulsContext.CONTRACT_ADDRESS_TYPE != type) { return false; } return true; }
try { chainId = byteBuffer.readShort(); type = byteBuffer.readByte(); } catch (NulsException e) { Log.error(e);
try { chainId = byteBuffer.readShort(); type = byteBuffer.readByte(); } catch (NulsException e) { Log.error(e);
try { chainId = byteBuffer.readShort(); type = byteBuffer.readByte(); } catch (NulsException e) { Log.error(e);