Transaction extends NeoSerializable { public byte[] getHashData() { return ArrayUtils.concatenate(NeoConfig.magicNumber(), toArrayWithoutWitnesses()); } Transaction();  Transaction(Neow3j neow, byte version, long nonce, long validUntilBlock, List<Signer> signers,
            long systemFee, long networkFee, List<TransactionAttribute> attributes, byte[] script,
            List<Witness> witnesses); byte getVersion(); long getNonce(); long getValidUntilBlock(); List<Signer> getSigners(); ScriptHash getSender(); long getSystemFee(); long getNetworkFee(); List<TransactionAttribute> getAttributes(); byte[] getScript(); List<Witness> getWitnesses(); void addWitness(Witness witness); String getTxId(); NeoSendRawTransaction send(); @Override int getSize(); @Override void deserialize(BinaryReader reader); @Override void serialize(BinaryWriter writer); byte[] toArrayWithoutWitnesses(); byte[] getHashData(); @Override byte[] toArray(); static final int HEADER_SIZE; }
@Test public void getHashData() { byte[] magicNumber = new byte[]{0x4e, 0x45, 0x4F, 0x00}; NeoConfig.setMagicNumber(magicNumber); List<Signer> signers = new ArrayList<>(); signers.add(Signer.feeOnly(account1)); Transaction tx = new Transaction(neow, (byte) 0, 0L, 0L, signers, 0L, 0L, new ArrayList<>(), new byte[]{1, 2, 3}, new ArrayList<>()); byte[] txHexWithoutWitness = Numeric.hexStringToByteArray( "000000000000000000000000000000000000000000000000000123ba2703c53263e8d6e522dc32203339dcd8eee9000003010203"); byte[] expectedData = ArrayUtils.concatenate(magicNumber, txHexWithoutWitness); assertThat(tx.getHashData(), is(expectedData)); }