@Override protected TransactionLogicData parseTxData(NulsByteBuffer byteBuffer) throws NulsException { byteBuffer.readBytes(NulsConstant.PLACE_HOLDER.length); return null; }
@Override protected TransactionLogicData parseTxData(NulsByteBuffer byteBuffer) throws NulsException { byteBuffer.readBytes(NulsConstant.PLACE_HOLDER.length); return null; }
public double readDouble() throws NulsException { byte[] bytes = this.readBytes(8); if (null == bytes) { return 0; } return SerializeUtils.bytes2Double(bytes); }
@Override public void parse(NulsByteBuffer byteBuffer) throws NulsException { int count = (int) byteBuffer.readVarInt(); addressList.clear(); for (int i = 0; i < count; i++) { addressList.add(byteBuffer.readBytes(Address.ADDRESS_LENGTH)); } }
public short readShort() throws NulsException { byte[] bytes = this.readBytes(2); if (null == bytes) { return 0; } return SerializeUtils.bytes2Short(bytes); }
public byte[] readByLengthByte() throws NulsException { long length = this.readVarInt(); if (length == 0) { return null; } return readBytes((int) length); }
@Override public void parse(NulsByteBuffer byteBuffer) throws NulsException { this.deposit = Na.valueOf(byteBuffer.readInt64()); this.agentAddress = byteBuffer.readBytes(Address.ADDRESS_LENGTH); this.packingAddress = byteBuffer.readBytes(Address.ADDRESS_LENGTH); this.rewardAddress = byteBuffer.readBytes(Address.ADDRESS_LENGTH); this.commissionRate = byteBuffer.readDouble(); }
@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.hash = byteBuffer.readHash(); this.agentAddress = byteBuffer.readBytes(Address.ADDRESS_LENGTH); this.packingAddress = byteBuffer.readBytes(Address.ADDRESS_LENGTH); this.rewardAddress = byteBuffer.readBytes(Address.ADDRESS_LENGTH); this.deposit = Na.valueOf(byteBuffer.readInt64()); this.commissionRate = byteBuffer.readDouble(); this.time = byteBuffer.readUint48(); this.blockHeight = byteBuffer.readVarInt(); this.delHeight = byteBuffer.readVarInt(); }
@Override public void parse(NulsByteBuffer byteBuffer) throws NulsException { byte[] bytes = byteBuffer.readBytes(Address.ADDRESS_LENGTH); this.address = Address.fromHashs(bytes); this.m = byteBuffer.readUint32(); this.pubKeyList = new ArrayList<>(); long count = byteBuffer.readUint32(); for (int i = 0; i < count; i++) { pubKeyList.add(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.deposit = Na.valueOf(byteBuffer.readInt64()); this.address = byteBuffer.readBytes(Address.ADDRESS_LENGTH); this.agentHash = byteBuffer.readHash(); }
@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 { // 从流中读取签名,兼容新老版本 int course = 0; boolean isScript = false; List<P2PHKSignature> p2PHKSignatures = new ArrayList<>(); List<Script> scripts = new ArrayList<>(); while (!byteBuffer.isFinished()) { course = byteBuffer.getCursor(); //读取两个字节(脚本标识位),如果两个字节都为0x00则表示后面的数据流为脚本数据 if (!isScript && byteBuffer.getPayload().length < 2) { break; } if (isScript || Arrays.equals(NulsConstant.SIGN_HOLDER, byteBuffer.readBytes(2))) { isScript = true; if (!byteBuffer.isFinished()) { scripts.add(new Script(byteBuffer.readByLengthByte())); } } else { byteBuffer.setCursor(course); p2PHKSignatures.add(byteBuffer.readNulsData(new P2PHKSignature())); } } this.p2PHKSignatures = p2PHKSignatures; this.scripts = scripts; }
@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.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.deposit = Na.valueOf(byteBuffer.readInt64()); this.agentHash = byteBuffer.readHash(); this.address = byteBuffer.readBytes(Address.ADDRESS_LENGTH); this.time = byteBuffer.readUint48(); this.txHash = byteBuffer.readHash(); this.blockHeight = byteBuffer.readVarInt(); this.delHeight = byteBuffer.readVarInt(); }