fix: cast double to int before sign and send transcation (#14)
This commit is contained in:
parent
e9c9019b50
commit
fd9467ef79
|
@ -398,10 +398,12 @@ class SubstrateSdk with ChangeNotifier {
|
||||||
);
|
);
|
||||||
final txInfo = TxInfoData(
|
final txInfo = TxInfoData(
|
||||||
'balances', amount == -1 ? 'transferAll' : 'transferKeepAlive', sender);
|
'balances', amount == -1 ? 'transferAll' : 'transferKeepAlive', sender);
|
||||||
|
|
||||||
|
final int amountUnit = (amount * 100).toInt();
|
||||||
try {
|
try {
|
||||||
final hash = await sdk.api.tx.signAndSend(
|
final hash = await sdk.api.tx.signAndSend(
|
||||||
txInfo,
|
txInfo,
|
||||||
[destAddress, amount == -1 ? false : (amount * 100)],
|
[destAddress, amount == -1 ? false : amountUnit],
|
||||||
password,
|
password,
|
||||||
onStatusChange: (status) {
|
onStatusChange: (status) {
|
||||||
log.d('Transaction status: ' + status);
|
log.d('Transaction status: ' + status);
|
||||||
|
@ -611,6 +613,7 @@ class SubstrateSdk with ChangeNotifier {
|
||||||
final int _removableOn = _certData['removableOn'] ?? 0;
|
final int _removableOn = _certData['removableOn'] ?? 0;
|
||||||
final int _renewableOn = _certData['renewableOn'] ?? 0;
|
final int _renewableOn = _certData['renewableOn'] ?? 0;
|
||||||
final int _nextIssuableOn = _certMeta['nextIssuableOn'] ?? 0;
|
final int _nextIssuableOn = _certMeta['nextIssuableOn'] ?? 0;
|
||||||
|
//TODO: use _removableOn instead of _renewableOn
|
||||||
log.d(_renewableOn.toString() +
|
log.d(_renewableOn.toString() +
|
||||||
'\n' +
|
'\n' +
|
||||||
_removableOn.toString() +
|
_removableOn.toString() +
|
||||||
|
|
Loading…
Reference in New Issue