mirror of
https://github.com/cake-tech/cake_wallet.git
synced 2025-03-12 09:32:33 +00:00
fix invalid zano imports, add support for linux, speed up CI builds
This commit is contained in:
parent
0d2edb8b69
commit
1432114509
7 changed files with 21 additions and 16 deletions
|
@ -13,11 +13,13 @@ class ZanoTransactionInfo extends TransactionInfo {
|
|||
required this.isPending,
|
||||
required this.zanoAmount,
|
||||
required this.fee,
|
||||
required this.assetId,
|
||||
required this.confirmations,
|
||||
required this.tokenSymbol,
|
||||
required this.decimalPoint,
|
||||
}) : amount = zanoAmount.isValidInt ? zanoAmount.toInt() : 0;
|
||||
required String assetId,
|
||||
}) : amount = zanoAmount.isValidInt ? zanoAmount.toInt() : 0 {
|
||||
additionalInfo['assetId'] = assetId;
|
||||
}
|
||||
|
||||
ZanoTransactionInfo.fromTransfer(Transfer transfer,
|
||||
{required int confirmations,
|
||||
|
@ -33,15 +35,16 @@ class ZanoTransactionInfo extends TransactionInfo {
|
|||
zanoAmount = amount,
|
||||
amount = amount.isValidInt ? amount.toInt() : 0,
|
||||
fee = transfer.fee,
|
||||
assetId = assetId,
|
||||
confirmations = confirmations,
|
||||
isPending = false,
|
||||
recipientAddress = transfer.remoteAddresses.isNotEmpty ? transfer.remoteAddresses.first : '' {
|
||||
additionalInfo = <String, dynamic>{
|
||||
'comment': transfer.comment,
|
||||
'assetId': assetId,
|
||||
};
|
||||
}
|
||||
|
||||
String get assetId => additionalInfo["assetId"] as String;
|
||||
set assetId(String newId) => additionalInfo["assetId"] = newId;
|
||||
final String id;
|
||||
final int height;
|
||||
final TransactionDirection direction;
|
||||
|
@ -54,7 +57,6 @@ class ZanoTransactionInfo extends TransactionInfo {
|
|||
final int decimalPoint;
|
||||
late String recipientAddress;
|
||||
final String tokenSymbol;
|
||||
late String assetId;
|
||||
String? _fiatAmount;
|
||||
String? key;
|
||||
|
||||
|
|
|
@ -2,10 +2,9 @@ import 'package:bitcoin_base/bitcoin_base.dart';
|
|||
import 'package:cake_wallet/generated/i18n.dart';
|
||||
import 'package:cake_wallet/core/validator.dart';
|
||||
import 'package:cake_wallet/solana/solana.dart';
|
||||
import 'package:cake_wallet/zano/zano.dart';
|
||||
import 'package:cw_core/crypto_currency.dart';
|
||||
import 'package:cw_core/erc20_token.dart';
|
||||
import 'package:cw_zano/zano_utils.dart';
|
||||
|
||||
const BEFORE_REGEX = '(^|\\s)';
|
||||
const AFTER_REGEX = '(\$|\\s)';
|
||||
|
||||
|
@ -21,7 +20,7 @@ class AddressValidator extends TextValidator {
|
|||
: LitecoinNetwork.mainnet,
|
||||
)
|
||||
: type == CryptoCurrency.zano
|
||||
? ZanoUtils.validateAddress
|
||||
? zano!.validateAddress
|
||||
: null,
|
||||
pattern: getPattern(type),
|
||||
length: getLength(type));
|
||||
|
|
|
@ -20,7 +20,6 @@ import 'package:cake_wallet/view_model/send/send_view_model.dart';
|
|||
import 'package:collection/collection.dart';
|
||||
import 'package:cw_core/transaction_direction.dart';
|
||||
import 'package:cw_core/transaction_priority.dart';
|
||||
import 'package:cw_zano/model/zano_transaction_info.dart';
|
||||
import 'package:flutter/foundation.dart';
|
||||
import 'package:hive/hive.dart';
|
||||
import 'package:intl/src/intl/date_format.dart';
|
||||
|
@ -785,11 +784,10 @@ abstract class TransactionDetailsViewModelBase with Store {
|
|||
}
|
||||
|
||||
void _addZanoListItems(TransactionInfo tx, DateFormat dateFormat) {
|
||||
tx as ZanoTransactionInfo;
|
||||
final comment = tx.additionalInfo['comment'] as String?;
|
||||
items.addAll([
|
||||
StandartListItem(title: S.current.transaction_details_transaction_id, value: tx.id),
|
||||
StandartListItem(title: 'Asset ID', value: tx.assetId),
|
||||
StandartListItem(title: 'Asset ID', value: tx.additionalInfo['assetId'] as String? ?? "Unknown asset id"),
|
||||
StandartListItem(
|
||||
title: S.current.transaction_details_date, value: dateFormat.format(tx.date)),
|
||||
StandartListItem(title: S.current.transaction_details_height, value: '${tx.height}'),
|
||||
|
|
|
@ -141,4 +141,7 @@ class CWZano extends Zano {
|
|||
|
||||
@override
|
||||
String getAddress(WalletBase wallet) => (wallet as ZanoWallet).walletAddresses.address;
|
||||
|
||||
@override
|
||||
bool validateAddress(String address) => ZanoUtils.validateAddress(address);
|
||||
}
|
||||
|
|
|
@ -19,6 +19,7 @@ fi
|
|||
if [[ ! "x$RUNNER_OS" == "x" ]];
|
||||
then
|
||||
REMOVE_CACHES=ON
|
||||
BUILD_ONLY_AARCH64=ON
|
||||
fi
|
||||
|
||||
# NOTE: -j1 is intentional. Otherwise you will run into weird behaviour on macos
|
||||
|
@ -37,19 +38,19 @@ else
|
|||
for COIN in monero wownero zano;
|
||||
do
|
||||
pushd ../monero_c
|
||||
env -i ./build_single.sh ${COIN} x86_64-linux-android $NPROC
|
||||
[[ ! "x$BUILD_ONLY_AARCH64" == "x" ]] && env -i ./build_single.sh ${COIN} x86_64-linux-android $NPROC
|
||||
[[ ! "x$REMOVE_CACHES" == "x" ]] && rm -rf ${COIN}/contrib/depends/x86_64-linux-android
|
||||
# ./build_single.sh ${COIN} i686-linux-android $NPROC
|
||||
# [[ ! "x$REMOVE_CACHES" == "x" ]] && rm -rf ${COIN}/contrib/depends/i686-linux-android
|
||||
env -i ./build_single.sh ${COIN} armv7a-linux-androideabi $NPROC
|
||||
[[ ! "x$BUILD_ONLY_AARCH64" == "x" ]] && env -i ./build_single.sh ${COIN} armv7a-linux-androideabi $NPROC
|
||||
[[ ! "x$REMOVE_CACHES" == "x" ]] && rm -rf ${COIN}/contrib/depends/armv7a-linux-androideabi
|
||||
env -i ./build_single.sh ${COIN} aarch64-linux-android $NPROC
|
||||
[[ ! "x$REMOVE_CACHES" == "x" ]] && rm -rf ${COIN}/contrib/depends/aarch64-linux-android
|
||||
|
||||
popd
|
||||
unxz -f ../monero_c/release/${COIN}/x86_64-linux-android_libwallet2_api_c.so.xz
|
||||
[[ ! "x$BUILD_ONLY_AARCH64" == "x" ]] && unxz -f ../monero_c/release/${COIN}/x86_64-linux-android_libwallet2_api_c.so.xz
|
||||
|
||||
unxz -f ../monero_c/release/${COIN}/armv7a-linux-androideabi_libwallet2_api_c.so.xz
|
||||
[[ ! "x$BUILD_ONLY_AARCH64" == "x" ]] && unxz -f ../monero_c/release/${COIN}/armv7a-linux-androideabi_libwallet2_api_c.so.xz
|
||||
|
||||
unxz -f ../monero_c/release/${COIN}/aarch64-linux-android_libwallet2_api_c.so.xz
|
||||
[[ ! "x$REMOVE_CACHES" == "x" ]] && rm -rf ${COIN}/contrib/depends/{built,sources}
|
||||
|
|
|
@ -13,7 +13,7 @@ CONFIG_ARGS=""
|
|||
|
||||
case $APP_LINUX_TYPE in
|
||||
$CAKEWALLET)
|
||||
CONFIG_ARGS="--monero --bitcoin --ethereum --polygon --nano --bitcoinCash --solana --tron --wownero --excludeFlutterSecureStorage";;
|
||||
CONFIG_ARGS="--monero --bitcoin --ethereum --polygon --nano --bitcoinCash --solana --tron --wownero --excludeFlutterSecureStorage --zano";;
|
||||
esac
|
||||
|
||||
cp -rf pubspec_description.yaml pubspec.yaml
|
||||
|
|
|
@ -1415,6 +1415,7 @@ import 'package:cw_zano/model/zano_transaction_info.dart';
|
|||
import 'package:cw_zano/zano_formatter.dart';
|
||||
import 'package:cw_zano/zano_wallet.dart';
|
||||
import 'package:cw_zano/zano_wallet_service.dart';
|
||||
import 'package:cw_zano/zano_utils.dart';
|
||||
""";
|
||||
const zanoCwPart = "part 'cw_zano.dart';";
|
||||
const zanoContent = """
|
||||
|
@ -1446,6 +1447,7 @@ abstract class Zano {
|
|||
Future<void> deleteZanoAsset(WalletBase wallet, CryptoCurrency token);
|
||||
Future<CryptoCurrency?> getZanoAsset(WalletBase wallet, String contractAddress);
|
||||
String getAddress(WalletBase wallet);
|
||||
bool validateAddress(String address);
|
||||
}
|
||||
""";
|
||||
const zanoEmptyDefinition = 'Zano? zano;\n';
|
||||
|
|
Loading…
Reference in a new issue