mirror of
https://github.com/cypherstack/stack_wallet.git
synced 2024-12-23 03:49:22 +00:00
Merge pull request #520 from cypherstack/add-epic-send-to-address
fix: Add send to address for epic when sending
This commit is contained in:
commit
6efa5597bf
1 changed files with 12 additions and 9 deletions
|
@ -452,8 +452,6 @@ class EpicCashWallet extends CoinServiceAPI
|
|||
|
||||
EpicBoxConfigModel epicboxConfig = await getEpicBoxConfig();
|
||||
|
||||
print("EPICBOX CONFIG HERE IS $epicboxConfig");
|
||||
|
||||
// TODO determine whether it is worth sending change to a change address.
|
||||
dynamic message;
|
||||
|
||||
|
@ -522,6 +520,11 @@ class EpicCashWallet extends CoinServiceAPI
|
|||
throw BadEpicHttpAddressException(message: sendTx);
|
||||
}
|
||||
|
||||
Map<String, String> txAddressInfo = {};
|
||||
txAddressInfo['from'] = await currentReceivingAddress;
|
||||
txAddressInfo['to'] = txData['addresss'] as String;
|
||||
await putSendToAddresses(sendTx, txAddressInfo);
|
||||
|
||||
Logging.instance.log("CONFIRM_RESULT_IS $sendTx", level: LogLevel.Info);
|
||||
|
||||
final decodeData = json.decode(sendTx);
|
||||
|
@ -1247,7 +1250,6 @@ class EpicCashWallet extends CoinServiceAPI
|
|||
await _secureStore.write(key: '${_walletId}_config', value: stringConfig);
|
||||
await _secureStore.write(key: '${_walletId}_password', value: password);
|
||||
|
||||
print("EPIC BOX MODEL IS ${epicboxConfig.toString()}");
|
||||
await _secureStore.write(
|
||||
key: '${_walletId}_epicboxConfig', value: epicboxConfig.toString());
|
||||
|
||||
|
@ -1390,7 +1392,8 @@ class EpicCashWallet extends CoinServiceAPI
|
|||
}
|
||||
}
|
||||
|
||||
Future<bool> putSendToAddresses(String slateMessage) async {
|
||||
Future<bool> putSendToAddresses(
|
||||
String slateMessage, Map<String, String> txAddressInfo) async {
|
||||
try {
|
||||
var slatesToCommits = await getSlatesToCommits();
|
||||
final slate0 = jsonDecode(slateMessage);
|
||||
|
@ -1400,19 +1403,19 @@ class EpicCashWallet extends CoinServiceAPI
|
|||
final slateId = part1[0]['tx_slate_id'];
|
||||
final commitId = part2['tx']['body']['outputs'][0]['commit'];
|
||||
|
||||
final toFromInfoString = jsonDecode(slateMessage);
|
||||
final toFromInfo = jsonDecode(toFromInfoString[1] as String);
|
||||
final from = toFromInfo['from'];
|
||||
final to = toFromInfo['to'];
|
||||
final from = txAddressInfo['from'];
|
||||
final to = txAddressInfo['to'];
|
||||
slatesToCommits[slateId] = {
|
||||
"commitId": commitId,
|
||||
"from": from,
|
||||
"to": to,
|
||||
};
|
||||
|
||||
await epicUpdateSlatesToCommits(slatesToCommits);
|
||||
return true;
|
||||
} catch (e, s) {
|
||||
Logging.instance.log("$e $s", level: LogLevel.Error);
|
||||
Logging.instance
|
||||
.log("ERROR STORING ADDRESS $e $s", level: LogLevel.Error);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue