Updated on 2026-08-14

This commit is contained in:
Tangem 2018-10-26 10:59:36 +03:00
parent 61ef397705
commit bae8bd0e6c
30 changed files with 1686 additions and 1276 deletions

View file

@ -9,7 +9,7 @@ import android.util.Log;
import com.tangem.domain.wallet.Base58;
import com.tangem.domain.wallet.BitcoinException;
import com.tangem.domain.wallet.BitcoinOutputStream;
import com.tangem.domain.wallet.TangemCard;
import com.tangem.domain.wallet.BtcData;
import com.tangem.domain.wallet.Transaction;
import com.tangem.domain.wallet.UnspentOutputInfo;
@ -325,10 +325,10 @@ public final class BTCUtils {
}
return false;
}
public static ArrayList<UnspentOutputInfo> getOutputs(List<TangemCard.UnspentTransaction> rawTxList, byte[] outputScriptWeAreAbleToSpend) throws BitcoinException {
public static ArrayList<UnspentOutputInfo> getOutputs(List<BtcData.UnspentTransaction> rawTxList, byte[] outputScriptWeAreAbleToSpend) throws BitcoinException {
ArrayList<UnspentOutputInfo> unspentOutputs = new ArrayList<>();
for(TangemCard.UnspentTransaction current: rawTxList)
for(BtcData.UnspentTransaction current: rawTxList)
{
byte[] rawTxByte = BTCUtils.fromHex(current.Raw);
if (rawTxByte == null || current.Raw.isEmpty())

View file

@ -406,7 +406,7 @@ public class Util {
(byte) value};
}
public static int byteArrayToInt(byte[] byteArray) {
public static int byteArrayToInt(byte[] byteArray) throws IllegalArgumentException {
if( byteArray.length==1 ) return byteArray[0]&0xFF;
java.nio.ByteBuffer BB=java.nio.ByteBuffer.wrap(byteArray);
switch (byteArray.length)
@ -417,7 +417,7 @@ public class Util {
}
}
public static long byteArrayToLong(byte[] byteArray) {
public static long byteArrayToLong(byte[] byteArray) throws IllegalArgumentException {
if( byteArray.length==1 ) return byteArray[0]&0xFF;
java.nio.ByteBuffer BB=java.nio.ByteBuffer.wrap(byteArray);
switch (byteArray.length)
@ -442,7 +442,7 @@ public class Util {
(byte) value};
}
public static int byteArrayToInt(byte[] byteArray, int startPos, int length) {
public static int byteArrayToInt(byte[] byteArray, int startPos, int length) throws IllegalArgumentException {
if (byteArray == null) {
throw new IllegalArgumentException("Parameter 'byteArray' cannot be null");
}
@ -459,7 +459,7 @@ public class Util {
return value;
}
public static long byteArrayToLong(byte[] byteArray, int startPos, int length) {
public static long byteArrayToLong(byte[] byteArray, int startPos, int length) throws IllegalArgumentException {
if (byteArray == null) {
throw new IllegalArgumentException("Parameter 'byteArray' cannot be null");
}