mirror of
https://github.com/bitcoinj/bitcoinj.git
synced 2024-11-19 01:40:26 +01:00
Message, TransactionInput, TransactionOutput, TransactionOutPoint, TransactionWitness, PartialMerkleTree: remove deprecated method getMessageSize()
This commit is contained in:
parent
dc7d64f7cb
commit
72a2832ae8
@ -34,14 +34,6 @@ public interface Message {
|
||||
*/
|
||||
int messageSize();
|
||||
|
||||
/**
|
||||
* @deprecated use {@link #messageSize()}
|
||||
*/
|
||||
@Deprecated
|
||||
default int getMessageSize() {
|
||||
return messageSize();
|
||||
}
|
||||
|
||||
/**
|
||||
* Serialize this message to a byte array that conforms to the Bitcoin wire protocol.
|
||||
*
|
||||
|
@ -161,14 +161,6 @@ public class PartialMerkleTree {
|
||||
return size;
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated Use {@link #messageSize()}
|
||||
*/
|
||||
@Deprecated
|
||||
public int getMessageSize() {
|
||||
return messageSize();
|
||||
}
|
||||
|
||||
// Based on CPartialMerkleTree::TraverseAndBuild in Bitcoin Core.
|
||||
private static void traverseAndBuild(int height, int pos, List<Sha256Hash> allLeafHashes, byte[] includeBits,
|
||||
List<Boolean> matchedChildBits, List<Sha256Hash> resultHashes) {
|
||||
|
@ -198,14 +198,6 @@ public class TransactionInput {
|
||||
return size;
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated Use {@link #messageSize()}
|
||||
*/
|
||||
@Deprecated
|
||||
public int getMessageSize() {
|
||||
return messageSize();
|
||||
}
|
||||
|
||||
/**
|
||||
* Coinbase transactions have special inputs with hashes of zero. If this is such an input, returns true.
|
||||
*/
|
||||
|
@ -117,12 +117,6 @@ public class TransactionOutPoint {
|
||||
return write(ByteBuffer.allocate(BYTES)).array();
|
||||
}
|
||||
|
||||
/** @deprecated use {@link #BYTES} */
|
||||
@Deprecated
|
||||
public int getMessageSize() {
|
||||
return BYTES;
|
||||
}
|
||||
|
||||
/**
|
||||
* An outpoint is a part of a transaction input that points to the output of another transaction. If we have both
|
||||
* sides in memory, and they have been linked together, this returns a pointer to the connected output, or null
|
||||
|
@ -160,14 +160,6 @@ public class TransactionOutput {
|
||||
return size;
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated Use {@link #messageSize()}
|
||||
*/
|
||||
@Deprecated
|
||||
public int getMessageSize() {
|
||||
return messageSize();
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the value of this output. This is the amount of currency that the destination address
|
||||
* receives.
|
||||
|
@ -154,14 +154,6 @@ public class TransactionWitness {
|
||||
return size;
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated Use {@link #messageSize()}
|
||||
*/
|
||||
@Deprecated
|
||||
public int getMessageSize() {
|
||||
return messageSize();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
List<String> stringPushes = new ArrayList<>(pushes.size());
|
||||
|
@ -1233,9 +1233,9 @@ public class FullBlockTestGenerator {
|
||||
checkState(stream.size() == b64Original.block.messageSize() + 8);
|
||||
// This check fails because it was created for "retain mode" and the likely encoding is not "optimal".
|
||||
// We since removed this capability retain the original encoding, but could not rewrite this test data.
|
||||
// checkState(stream.size() == b64.getMessageSize());
|
||||
// checkState(stream.size() == b64.messageSize());
|
||||
// checkState(Arrays.equals(stream.toByteArray(), b64.serialize()));
|
||||
// checkState(b64.getOptimalEncodingMessageSize() == b64Original.block.getMessageSize());
|
||||
// checkState(b64.getOptimalEncodingMessageSize() == b64Original.block.messageSize());
|
||||
}
|
||||
blocks.add(new BlockAndValidity(b64, true, false, b64.getHash(), chainHeadHeight + 19, "b64"));
|
||||
spendableOutputs.offer(b64Original.getCoinbaseOutput());
|
||||
|
@ -1,27 +0,0 @@
|
||||
/*
|
||||
* Copyright by the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.bitcoinj.core;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
public class MessageTest {
|
||||
@Test
|
||||
public void deprecatedMembers() {
|
||||
Message message = new UnknownMessage("dummy");
|
||||
message.getMessageSize();
|
||||
}
|
||||
}
|
@ -58,7 +58,6 @@ public class TransactionOutPointTest {
|
||||
public void deprecatedMembers() {
|
||||
TransactionOutPoint outpoint = TransactionOutPoint.UNCONNECTED;
|
||||
outpoint.getHash();
|
||||
outpoint.getMessageSize();
|
||||
outpoint.getIndex();
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user