From 8414d7835b2e55cb4ab6728f1f04f7bcda7f2b49 Mon Sep 17 00:00:00 2001 From: Umair Sarfraz Date: Tue, 16 Mar 2021 15:36:56 +0100 Subject: [PATCH 01/14] feat: do some fixes around transfers --- .../backend/bindings/node/native/Cargo.lock | 45 +++++----- packages/shared/lib/typings/events.ts | 8 ++ packages/shared/lib/wallet.ts | 86 ++++++++++++++++++- packages/shared/lib/walletApi.ts | 15 +++- 4 files changed, 126 insertions(+), 28 deletions(-) diff --git a/packages/backend/bindings/node/native/Cargo.lock b/packages/backend/bindings/node/native/Cargo.lock index f8f70f8795b..97e1710eb73 100644 --- a/packages/backend/bindings/node/native/Cargo.lock +++ b/packages/backend/bindings/node/native/Cargo.lock @@ -268,7 +268,7 @@ dependencies = [ [[package]] name = "bee-common" version = "0.3.1-alpha" -source = "git+https://github.com/iotaledger/bee.git?branch=dev#48b73fdc08356c7e5d53d9503dc963409f537fd2" +source = "git+https://github.com/iotaledger/bee.git?branch=dev#1028da0cd374e74bf8091648d5fe5e9d445fe3fe" dependencies = [ "autocfg", "chrono", @@ -283,7 +283,7 @@ name = "bee-crypto" version = "0.2.0-alpha" source = "git+https://github.com/iotaledger/bee.git?rev=c42171ff33c80cc2efb183e244dc79b7f58d9ac4#c42171ff33c80cc2efb183e244dc79b7f58d9ac4" dependencies = [ - "bee-ternary 0.4.0-alpha (git+https://github.com/iotaledger/bee.git?rev=c42171ff33c80cc2efb183e244dc79b7f58d9ac4)", + "bee-ternary 0.4.0-alpha", "byteorder", "lazy_static", "thiserror", @@ -293,9 +293,9 @@ dependencies = [ [[package]] name = "bee-crypto" version = "0.2.0-alpha" -source = "git+https://github.com/iotaledger/bee.git?branch=dev#48b73fdc08356c7e5d53d9503dc963409f537fd2" +source = "git+https://github.com/iotaledger/bee.git?branch=dev#1028da0cd374e74bf8091648d5fe5e9d445fe3fe" dependencies = [ - "bee-ternary 0.4.0-alpha (git+https://github.com/iotaledger/bee.git?branch=dev)", + "bee-ternary 0.4.1-alpha", "byteorder", "lazy_static", "thiserror", @@ -315,7 +315,7 @@ dependencies = [ "bee-snapshot", "bee-storage", "bee-tangle", - "bee-ternary 0.4.0-alpha (git+https://github.com/iotaledger/bee.git?branch=dev)", + "bee-ternary 0.4.1-alpha", "digest 0.9.0", "flume", "futures", @@ -369,7 +369,7 @@ version = "0.1.0-alpha" source = "git+https://github.com/iotaledger/bee.git?rev=d379dc3f6d96bca53c32e53feb3e6b7a0a7372b4#d379dc3f6d96bca53c32e53feb3e6b7a0a7372b4" dependencies = [ "bee-crypto 0.2.0-alpha (git+https://github.com/iotaledger/bee.git?branch=dev)", - "bee-ternary 0.4.0-alpha (git+https://github.com/iotaledger/bee.git?branch=dev)", + "bee-ternary 0.4.1-alpha", "iota-crypto 0.3.0 (git+https://github.com/iotaledger/crypto.rs?rev=c3bf565eba62d0b81144174c2ff917bfde282e49)", "thiserror", ] @@ -391,7 +391,7 @@ dependencies = [ "bee-snapshot", "bee-storage", "bee-tangle", - "bee-ternary 0.4.0-alpha (git+https://github.com/iotaledger/bee.git?branch=dev)", + "bee-ternary 0.4.1-alpha", "futures", "futures-util", "fxhash", @@ -441,7 +441,7 @@ dependencies = [ [[package]] name = "bee-runtime" version = "0.1.1-alpha" -source = "git+https://github.com/iotaledger/bee.git?branch=dev#48b73fdc08356c7e5d53d9503dc963409f537fd2" +source = "git+https://github.com/iotaledger/bee.git?branch=dev#1028da0cd374e74bf8091648d5fe5e9d445fe3fe" dependencies = [ "async-trait", "bee-storage", @@ -473,7 +473,7 @@ dependencies = [ [[package]] name = "bee-storage" version = "0.2.0-alpha" -source = "git+https://github.com/iotaledger/bee.git?branch=dev#48b73fdc08356c7e5d53d9503dc963409f537fd2" +source = "git+https://github.com/iotaledger/bee.git?branch=dev#1028da0cd374e74bf8091648d5fe5e9d445fe3fe" dependencies = [ "async-trait", "futures", @@ -515,8 +515,8 @@ dependencies = [ [[package]] name = "bee-ternary" -version = "0.4.0-alpha" -source = "git+https://github.com/iotaledger/bee.git?branch=dev#48b73fdc08356c7e5d53d9503dc963409f537fd2" +version = "0.4.1-alpha" +source = "git+https://github.com/iotaledger/bee.git?branch=dev#1028da0cd374e74bf8091648d5fe5e9d445fe3fe" dependencies = [ "autocfg", "num-traits 0.2.14", @@ -1600,7 +1600,7 @@ dependencies = [ [[package]] name = "iota-client" version = "0.5.0-alpha.3" -source = "git+https://github.com/iotaledger/iota.rs?branch=dev#57a9e6809e2b67a7bd2787ea9b0be5b45fc63385" +source = "git+https://github.com/iotaledger/iota.rs?branch=dev#a97eebc7f9db3b629010eca5eebaa11eb25e824e" dependencies = [ "async-trait", "bee-common 0.3.1-alpha (git+https://github.com/iotaledger/bee.git?branch=dev)", @@ -1611,6 +1611,7 @@ dependencies = [ "chrono", "hex", "iota-crypto 0.3.0 (git+https://github.com/iotaledger/crypto.rs?rev=b849861b86c3f7357b7477de4253b7352b363627)", + "log", "num_cpus", "reqwest", "serde 1.0.124", @@ -1634,7 +1635,7 @@ dependencies = [ [[package]] name = "iota-core" version = "0.2.0-alpha.3" -source = "git+https://github.com/iotaledger/iota.rs?branch=dev#57a9e6809e2b67a7bd2787ea9b0be5b45fc63385" +source = "git+https://github.com/iotaledger/iota.rs?branch=dev#a97eebc7f9db3b629010eca5eebaa11eb25e824e" dependencies = [ "bee-common 0.3.1-alpha (git+https://github.com/iotaledger/bee.git?rev=c42171ff33c80cc2efb183e244dc79b7f58d9ac4)", "bee-message", @@ -1697,7 +1698,7 @@ dependencies = [ [[package]] name = "iota-wallet" version = "0.1.0" -source = "git+https://github.com/iotaledger/wallet.rs?branch=develop#292fbdca4cfca5f6b663911774d4ce3ec5a74a9e" +source = "git+https://github.com/iotaledger/wallet.rs?branch=develop#3db43cd4405ae2a421b61a12d6869219d6111271" dependencies = [ "async-trait", "backtrace", @@ -1776,9 +1777,9 @@ dependencies = [ [[package]] name = "libc" -version = "0.2.88" +version = "0.2.89" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "03b07a082330a35e43f63177cc01689da34fbffa0105e1246cf0311472cac73a" +checksum = "538c092e5586f4cdd7dd8078c4a79220e3e168880218124dcbce860f0ea938c6" [[package]] name = "libp2p" @@ -2087,9 +2088,9 @@ dependencies = [ [[package]] name = "mio" -version = "0.7.9" +version = "0.7.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a5dede4e2065b3842b8b0af444119f3aa331cc7cc2dd20388bfb0f5d5a38823a" +checksum = "2182a122f3b7f3f5329cb1972cee089ba2459a0a80a56935e6e674f096f8d839" dependencies = [ "libc", "log", @@ -2146,9 +2147,9 @@ dependencies = [ [[package]] name = "multimap" -version = "0.8.2" +version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1255076139a83bb467426e7f8d0134968a8118844faa755985e077cf31850333" +checksum = "e5ce46fe64a9d73be07dcbe690a38ce1b293be448fd8ce1e6c1b8062c9f72c6a" [[package]] name = "multipart" @@ -3872,9 +3873,9 @@ checksum = "eafc1b9b2dfc6f5529177b62cf806484db55b32dc7c9658a118e11bbeb33061d" [[package]] name = "version_check" -version = "0.9.2" +version = "0.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5a972e5669d67ba988ce3dc826706fb0a8b01471c088cb0b6110b805cc36aed" +checksum = "5fecdca9a5291cc2b8dcf7dc02453fee791a280f3743cb0905f8822ae463b3fe" [[package]] name = "void" diff --git a/packages/shared/lib/typings/events.ts b/packages/shared/lib/typings/events.ts index 667de44df03..7ca703fed8c 100644 --- a/packages/shared/lib/typings/events.ts +++ b/packages/shared/lib/typings/events.ts @@ -82,6 +82,7 @@ export interface ErrorEventPayload { } export interface BalanceChangeEventPayload { + indexationId: string accountId: string address: Address balanceChange: { @@ -101,6 +102,13 @@ export interface ConfirmationStateChangeEventPayload { confirmed: boolean } +export interface ReattachmentEventPayload { + indexationId: string; + accountId: string; + message: Message; + reattachedMessageId: string; +} + export enum TransferProgressEventType { // Syncing account. SyncingAccount = 'SyncingAccount', diff --git a/packages/shared/lib/wallet.ts b/packages/shared/lib/wallet.ts index 8864148fa55..150780db024 100644 --- a/packages/shared/lib/wallet.ts +++ b/packages/shared/lib/wallet.ts @@ -205,6 +205,22 @@ export const initialiseListeners = () => { const account = get(accounts).find((account) => account.id === response.payload.accountId) const message = response.payload.message + const essence = message.payload.data.essence + + if (!essence.data.internal) { + const { balanceOverview } = get(wallet); + const overview = get(balanceOverview); + + const incoming = essence.data.incoming ? overview.incomingRaw + essence.data.value : overview.incomingRaw; + const outgoing = essence.data.incoming ? overview.outgoingRaw : overview.outgoingRaw + essence.data.value; + + updateBalanceOverview( + overview.balanceRaw, + incoming, + outgoing + ) + } + const notificationMessage = localize('notifications.valueTx') .replace('{{value}}', formatUnit(message.payload.data.essence.data.value)) .replace('{{account}}', account.alias) @@ -219,6 +235,9 @@ export const initialiseListeners = () => { }, }) + /** + * Event listener for transfer confirmation state change + */ api.onConfirmationStateChange({ onSuccess(response) { const accounts = get(wallet).accounts @@ -226,6 +245,22 @@ export const initialiseListeners = () => { const message = response.payload.message const messageKey = response.payload.confirmed ? 'confirmed' : 'failed' + const essence = message.payload.data.essence + + if (!essence.data.internal) { + const { balanceOverview } = get(wallet); + const overview = get(balanceOverview); + + const incoming = essence.data.incoming ? overview.incomingRaw + essence.data.value : overview.incomingRaw; + const outgoing = essence.data.incoming ? overview.outgoingRaw : overview.outgoingRaw + essence.data.value; + + updateBalanceOverview( + overview.balanceRaw, + incoming, + outgoing + ) + } + const accountMessage = account.messages.find((_message) => _message.id === message.id) accountMessage.confirmed = response.payload.confirmed accounts.update((storedAccounts) => { @@ -271,18 +306,32 @@ export const initialiseListeners = () => { const { balanceOverview } = get(wallet); const overview = get(balanceOverview); - const incoming = overview.incomingRaw + balanceChange.received; - const outgoing = overview.outgoingRaw + balanceChange.spent; const balance = overview.balanceRaw - balanceChange.spent + balanceChange.received - updateBalanceOverview(balance, incoming, outgoing); + updateBalanceOverview(balance, overview.incomingRaw, overview.outgoingRaw); + + }, + onError(error) { + console.error(error) + }, + }) + /** + * Event listener for reattachment + */ + api.onReattachment({ + onSuccess(response) { + // Replace original message with reattachment + replaceMessage(response.payload.accountId, response.payload.reattachedMessageId, response.payload.message); }, onError(error) { console.error(error) }, }) + /** + * Event listener for transfer progress + */ api.onTransferProgress({ onSuccess(response) { transferState.set(response.payload.event.type) @@ -363,6 +412,37 @@ export const saveNewMessage = (accountId: string, message: Message): void => { }) }; +/** + * @method replaceMessage + * + * @param {string} accountId + * @param {string} messageId + * @param {Message} newMessage + * + * @returns {void} + */ +export const replaceMessage = (accountId: string, messageId: string, newMessage: Message): void => { + const { accounts } = get(wallet) + + accounts.update((storedAccounts) => { + return storedAccounts.map((storedAccount: WalletAccount) => { + if (storedAccount.id === accountId) { + return Object.assign, Partial>({} as WalletAccount, storedAccount, { + messages: storedAccount.messages.map((_message) => { + if (_message.id === messageId) { + return newMessage; + } + + return _message; + }) + }) + } + + return storedAccount; + }) + }) +}; + /** * Gets latest messages * diff --git a/packages/shared/lib/walletApi.ts b/packages/shared/lib/walletApi.ts index 3331a03f746..eb1fc7146bd 100644 --- a/packages/shared/lib/walletApi.ts +++ b/packages/shared/lib/walletApi.ts @@ -11,7 +11,15 @@ import type { } from './typings/bridge' import { ResponseTypes } from './typings/bridge' import type { ClientOptions } from './typings/client' -import type { BalanceChangeEventPayload, ConfirmationStateChangeEventPayload, ErrorEventPayload, Event, TransactionEventPayload, TransferProgressEventPayload } from './typings/events' +import type { + BalanceChangeEventPayload, + ConfirmationStateChangeEventPayload, + ErrorEventPayload, + Event, + TransactionEventPayload, + TransferProgressEventPayload, + ReattachmentEventPayload +} from './typings/events' import { ErrorType } from './typings/events' import type { Message } from './typings/message' import type { StrongholdStatus, Duration } from './typings/wallet' @@ -127,12 +135,12 @@ Wallet.onMessage((message: MessageResponse) => { // There is no message id // Something lower level has thrown an error // We should stop processing at this point - errorLog.update((log) => [ { type: ErrorType.ClientError, message: JSON.stringify(message), time: Date.now() }, ...log ]) + errorLog.update((log) => [{ type: ErrorType.ClientError, message: JSON.stringify(message), time: Date.now() }, ...log]) return } const _deleteCallbackId = (_id: string) => { - // Do not delete callback ids for events api methods + // Do not delete callback ids for events api methods if (!eventsApiResponseTypes.includes(message.type)) { delete callbacksStore[_id] } @@ -321,6 +329,7 @@ export interface ApiClient { onStrongholdStatusChange(callbacks: { onSuccess: (response: Event) => void, onError: (err: ErrorEventPayload) => void }) onNewTransaction(callbacks: { onSuccess: (response: Event) => void, onError: (err: ErrorEventPayload) => void }) + onReattachment(callbacks: { onSuccess: (response: Event) => void, onError: (err: ErrorEventPayload) => void }) onConfirmationStateChange(callbacks: { onSuccess: (response: Event) => void, onError: (err: ErrorEventPayload) => void }) onBalanceChange(callbacks: { onSuccess: (response: Event) => void, onError: (err: ErrorEventPayload) => void }) onTransferProgress(callbacks: { onSuccess: (response: Event) => void, onError: (err: ErrorEventPayload) => void }) From b95d87cdf2e4d3807bc0cae761d5636af9f95fb7 Mon Sep 17 00:00:00 2001 From: Umair Sarfraz Date: Wed, 17 Mar 2021 13:01:39 +0100 Subject: [PATCH 02/14] feat: allow overriding of messages in getLatestMessages() implementation --- packages/shared/lib/wallet.ts | 36 +++++++++++++++++++++++++------- packages/shared/lib/walletApi.ts | 2 +- 2 files changed, 29 insertions(+), 9 deletions(-) diff --git a/packages/shared/lib/wallet.ts b/packages/shared/lib/wallet.ts index 150780db024..d9b1f6e97c8 100644 --- a/packages/shared/lib/wallet.ts +++ b/packages/shared/lib/wallet.ts @@ -466,14 +466,34 @@ export const getLatestMessages = (accounts: WalletAccount[], count = 10): Accoun }) account.messages.forEach((message) => { - messages[message.id] = Object.assign< - AccountMessage, - Message, - Partial - >( - {} as AccountMessage, - message, - { account: account.index }); + + if (message.id in messages) { + const existingMessage = messages[message.id]; + + // If a copy of the message exists, only override it if the new message is confirmed and the existing one is unconfirmed + // Imagine an internal transfer (between accounts). + // If the first account already updates the confirmation state as confirmed, there is a chance that the user might see the confirmation state + // changing from confirmed to unconfirmed. To avoid that, we always give preference to the message that's already confirmed. + if (!existingMessage.confirmed && message.confirmed) { + messages[message.id] = Object.assign< + AccountMessage, + Message, + Partial + >( + {} as AccountMessage, + message, + { account: account.index }); + } + } else { + messages[message.id] = Object.assign< + AccountMessage, + Message, + Partial + >( + {} as AccountMessage, + message, + { account: account.index }); + } }) }); diff --git a/packages/shared/lib/walletApi.ts b/packages/shared/lib/walletApi.ts index eb1fc7146bd..b9f0ff2fc34 100644 --- a/packages/shared/lib/walletApi.ts +++ b/packages/shared/lib/walletApi.ts @@ -130,7 +130,7 @@ const eventsApiResponseTypes = Object.values(eventsApiToResponseTypeMap) * Receives messages from wallet.rs. */ -Wallet.onMessage((message: MessageResponse) => { +Wallet.onMessage((message: MessageResponse) => { if (message && message.id === undefined) { // There is no message id // Something lower level has thrown an error From d59c3695b90193d3e2548cbcb4abe93dd3f474fe Mon Sep 17 00:00:00 2001 From: Umair Sarfraz Date: Wed, 17 Mar 2021 13:47:05 +0100 Subject: [PATCH 03/14] chore: update wallet.rs --- .../backend/bindings/node/native/Cargo.lock | 257 +++++++++++++++--- 1 file changed, 222 insertions(+), 35 deletions(-) diff --git a/packages/backend/bindings/node/native/Cargo.lock b/packages/backend/bindings/node/native/Cargo.lock index 97e1710eb73..fb2b356cc14 100644 --- a/packages/backend/bindings/node/native/Cargo.lock +++ b/packages/backend/bindings/node/native/Cargo.lock @@ -84,6 +84,17 @@ version = "0.4.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "739f4a8db6605981345c5654f3a85b056ce52f37a39d34da03f25bf2151ea16e" +[[package]] +name = "ahash" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f200cbb1e856866d9eade941cf3aa0c5d7dd36f74311c4273b494f4ef036957" +dependencies = [ + "getrandom 0.2.2", + "once_cell", + "version_check", +] + [[package]] name = "aho-corasick" version = "0.7.15" @@ -302,6 +313,32 @@ dependencies = [ "tiny-keccak", ] +[[package]] +name = "bee-ledger" +version = "0.1.0-alpha" +source = "git+https://github.com/iotaledger/bee.git?rev=26215e3af88af4c54f460df7cffc39d26fdd6e05#26215e3af88af4c54f460df7cffc39d26fdd6e05" +dependencies = [ + "async-trait", + "bee-common 0.3.1-alpha (git+https://github.com/iotaledger/bee.git?branch=dev)", + "bee-crypto 0.2.0-alpha (git+https://github.com/iotaledger/bee.git?branch=dev)", + "bee-message 0.1.0-alpha (git+https://github.com/iotaledger/bee.git?rev=26215e3af88af4c54f460df7cffc39d26fdd6e05)", + "bee-runtime", + "bee-snapshot 0.1.0-alpha (git+https://github.com/iotaledger/bee.git?rev=26215e3af88af4c54f460df7cffc39d26fdd6e05)", + "bee-storage", + "bee-tangle 0.1.0-alpha (git+https://github.com/iotaledger/bee.git?rev=26215e3af88af4c54f460df7cffc39d26fdd6e05)", + "bee-ternary 0.4.1-alpha", + "digest 0.9.0", + "flume", + "futures", + "hex", + "iota-crypto 0.3.0 (git+https://github.com/iotaledger/crypto.rs?rev=c3bf565eba62d0b81144174c2ff917bfde282e49)", + "log", + "serde 1.0.124", + "thiserror", + "tokio", + "tokio-stream", +] + [[package]] name = "bee-ledger" version = "0.1.0-alpha" @@ -310,11 +347,11 @@ dependencies = [ "async-trait", "bee-common 0.3.1-alpha (git+https://github.com/iotaledger/bee.git?branch=dev)", "bee-crypto 0.2.0-alpha (git+https://github.com/iotaledger/bee.git?branch=dev)", - "bee-message", + "bee-message 0.1.0-alpha (git+https://github.com/iotaledger/bee.git?rev=d379dc3f6d96bca53c32e53feb3e6b7a0a7372b4)", "bee-runtime", - "bee-snapshot", + "bee-snapshot 0.1.0-alpha (git+https://github.com/iotaledger/bee.git?rev=d379dc3f6d96bca53c32e53feb3e6b7a0a7372b4)", "bee-storage", - "bee-tangle", + "bee-tangle 0.1.0-alpha (git+https://github.com/iotaledger/bee.git?rev=d379dc3f6d96bca53c32e53feb3e6b7a0a7372b4)", "bee-ternary 0.4.1-alpha", "digest 0.9.0", "flume", @@ -328,6 +365,22 @@ dependencies = [ "tokio-stream", ] +[[package]] +name = "bee-message" +version = "0.1.0-alpha" +source = "git+https://github.com/iotaledger/bee.git?rev=26215e3af88af4c54f460df7cffc39d26fdd6e05#26215e3af88af4c54f460df7cffc39d26fdd6e05" +dependencies = [ + "bech32", + "bee-common 0.3.1-alpha (git+https://github.com/iotaledger/bee.git?branch=dev)", + "bee-pow 0.1.0-alpha (git+https://github.com/iotaledger/bee.git?rev=26215e3af88af4c54f460df7cffc39d26fdd6e05)", + "digest 0.9.0", + "hex", + "iota-crypto 0.3.0 (git+https://github.com/iotaledger/crypto.rs?rev=c3bf565eba62d0b81144174c2ff917bfde282e49)", + "ref-cast", + "serde 1.0.124", + "thiserror", +] + [[package]] name = "bee-message" version = "0.1.0-alpha" @@ -335,7 +388,7 @@ source = "git+https://github.com/iotaledger/bee.git?rev=d379dc3f6d96bca53c32e53f dependencies = [ "bech32", "bee-common 0.3.1-alpha (git+https://github.com/iotaledger/bee.git?branch=dev)", - "bee-pow", + "bee-pow 0.1.0-alpha (git+https://github.com/iotaledger/bee.git?rev=d379dc3f6d96bca53c32e53feb3e6b7a0a7372b4)", "digest 0.9.0", "hex", "iota-crypto 0.3.0 (git+https://github.com/iotaledger/crypto.rs?rev=c3bf565eba62d0b81144174c2ff917bfde282e49)", @@ -344,6 +397,25 @@ dependencies = [ "thiserror", ] +[[package]] +name = "bee-network" +version = "0.1.0-alpha" +source = "git+https://github.com/iotaledger/bee.git?rev=26215e3af88af4c54f460df7cffc39d26fdd6e05#26215e3af88af4c54f460df7cffc39d26fdd6e05" +dependencies = [ + "async-trait", + "bee-runtime", + "futures", + "lazy_static", + "libp2p", + "log", + "rand 0.8.3", + "serde 1.0.124", + "thiserror", + "tokio", + "tokio-stream", + "url", +] + [[package]] name = "bee-network" version = "0.1.0-alpha" @@ -363,6 +435,17 @@ dependencies = [ "url", ] +[[package]] +name = "bee-pow" +version = "0.1.0-alpha" +source = "git+https://github.com/iotaledger/bee.git?rev=26215e3af88af4c54f460df7cffc39d26fdd6e05#26215e3af88af4c54f460df7cffc39d26fdd6e05" +dependencies = [ + "bee-crypto 0.2.0-alpha (git+https://github.com/iotaledger/bee.git?branch=dev)", + "bee-ternary 0.4.1-alpha", + "iota-crypto 0.3.0 (git+https://github.com/iotaledger/crypto.rs?rev=c3bf565eba62d0b81144174c2ff917bfde282e49)", + "thiserror", +] + [[package]] name = "bee-pow" version = "0.1.0-alpha" @@ -374,6 +457,42 @@ dependencies = [ "thiserror", ] +[[package]] +name = "bee-protocol" +version = "0.1.0-alpha" +source = "git+https://github.com/iotaledger/bee.git?rev=26215e3af88af4c54f460df7cffc39d26fdd6e05#26215e3af88af4c54f460df7cffc39d26fdd6e05" +dependencies = [ + "async-channel", + "async-priority-queue", + "async-trait", + "bee-common 0.3.1-alpha (git+https://github.com/iotaledger/bee.git?branch=dev)", + "bee-crypto 0.2.0-alpha (git+https://github.com/iotaledger/bee.git?branch=dev)", + "bee-ledger 0.1.0-alpha (git+https://github.com/iotaledger/bee.git?rev=26215e3af88af4c54f460df7cffc39d26fdd6e05)", + "bee-message 0.1.0-alpha (git+https://github.com/iotaledger/bee.git?rev=26215e3af88af4c54f460df7cffc39d26fdd6e05)", + "bee-network 0.1.0-alpha (git+https://github.com/iotaledger/bee.git?rev=26215e3af88af4c54f460df7cffc39d26fdd6e05)", + "bee-runtime", + "bee-snapshot 0.1.0-alpha (git+https://github.com/iotaledger/bee.git?rev=26215e3af88af4c54f460df7cffc39d26fdd6e05)", + "bee-storage", + "bee-tangle 0.1.0-alpha (git+https://github.com/iotaledger/bee.git?rev=26215e3af88af4c54f460df7cffc39d26fdd6e05)", + "bee-ternary 0.4.1-alpha", + "futures", + "futures-util", + "fxhash", + "hex", + "iota-crypto 0.3.0 (git+https://github.com/iotaledger/crypto.rs?rev=c3bf565eba62d0b81144174c2ff917bfde282e49)", + "log", + "num_cpus", + "pin-project 1.0.5", + "rand 0.8.3", + "ref-cast", + "serde 1.0.124", + "spin 0.7.1", + "thiserror", + "tokio", + "tokio-stream", + "twox-hash", +] + [[package]] name = "bee-protocol" version = "0.1.0-alpha" @@ -384,13 +503,13 @@ dependencies = [ "async-trait", "bee-common 0.3.1-alpha (git+https://github.com/iotaledger/bee.git?branch=dev)", "bee-crypto 0.2.0-alpha (git+https://github.com/iotaledger/bee.git?branch=dev)", - "bee-ledger", - "bee-message", - "bee-network", + "bee-ledger 0.1.0-alpha (git+https://github.com/iotaledger/bee.git?rev=d379dc3f6d96bca53c32e53feb3e6b7a0a7372b4)", + "bee-message 0.1.0-alpha (git+https://github.com/iotaledger/bee.git?rev=d379dc3f6d96bca53c32e53feb3e6b7a0a7372b4)", + "bee-network 0.1.0-alpha (git+https://github.com/iotaledger/bee.git?rev=d379dc3f6d96bca53c32e53feb3e6b7a0a7372b4)", "bee-runtime", - "bee-snapshot", + "bee-snapshot 0.1.0-alpha (git+https://github.com/iotaledger/bee.git?rev=d379dc3f6d96bca53c32e53feb3e6b7a0a7372b4)", "bee-storage", - "bee-tangle", + "bee-tangle 0.1.0-alpha (git+https://github.com/iotaledger/bee.git?rev=d379dc3f6d96bca53c32e53feb3e6b7a0a7372b4)", "bee-ternary 0.4.1-alpha", "futures", "futures-util", @@ -410,6 +529,21 @@ dependencies = [ "twox-hash", ] +[[package]] +name = "bee-rest-api" +version = "0.1.0-alpha" +source = "git+https://github.com/iotaledger/bee.git?rev=26215e3af88af4c54f460df7cffc39d26fdd6e05#26215e3af88af4c54f460df7cffc39d26fdd6e05" +dependencies = [ + "bee-ledger 0.1.0-alpha (git+https://github.com/iotaledger/bee.git?rev=26215e3af88af4c54f460df7cffc39d26fdd6e05)", + "bee-message 0.1.0-alpha (git+https://github.com/iotaledger/bee.git?rev=26215e3af88af4c54f460df7cffc39d26fdd6e05)", + "bee-pow 0.1.0-alpha (git+https://github.com/iotaledger/bee.git?rev=26215e3af88af4c54f460df7cffc39d26fdd6e05)", + "bee-protocol 0.1.0-alpha (git+https://github.com/iotaledger/bee.git?rev=26215e3af88af4c54f460df7cffc39d26fdd6e05)", + "bee-runtime", + "hex", + "serde 1.0.124", + "serde_json", +] + [[package]] name = "bee-rest-api" version = "0.1.0-alpha" @@ -418,14 +552,14 @@ dependencies = [ "async-trait", "bech32", "bee-common 0.3.1-alpha (git+https://github.com/iotaledger/bee.git?branch=dev)", - "bee-ledger", - "bee-message", - "bee-network", - "bee-pow", - "bee-protocol", + "bee-ledger 0.1.0-alpha (git+https://github.com/iotaledger/bee.git?rev=d379dc3f6d96bca53c32e53feb3e6b7a0a7372b4)", + "bee-message 0.1.0-alpha (git+https://github.com/iotaledger/bee.git?rev=d379dc3f6d96bca53c32e53feb3e6b7a0a7372b4)", + "bee-network 0.1.0-alpha (git+https://github.com/iotaledger/bee.git?rev=d379dc3f6d96bca53c32e53feb3e6b7a0a7372b4)", + "bee-pow 0.1.0-alpha (git+https://github.com/iotaledger/bee.git?rev=d379dc3f6d96bca53c32e53feb3e6b7a0a7372b4)", + "bee-protocol 0.1.0-alpha (git+https://github.com/iotaledger/bee.git?rev=d379dc3f6d96bca53c32e53feb3e6b7a0a7372b4)", "bee-runtime", "bee-storage", - "bee-tangle", + "bee-tangle 0.1.0-alpha (git+https://github.com/iotaledger/bee.git?rev=d379dc3f6d96bca53c32e53feb3e6b7a0a7372b4)", "digest 0.9.0", "futures", "hex", @@ -450,6 +584,26 @@ dependencies = [ "log", ] +[[package]] +name = "bee-snapshot" +version = "0.1.0-alpha" +source = "git+https://github.com/iotaledger/bee.git?rev=26215e3af88af4c54f460df7cffc39d26fdd6e05#26215e3af88af4c54f460df7cffc39d26fdd6e05" +dependencies = [ + "async-trait", + "bee-common 0.3.1-alpha (git+https://github.com/iotaledger/bee.git?branch=dev)", + "bee-message 0.1.0-alpha (git+https://github.com/iotaledger/bee.git?rev=26215e3af88af4c54f460df7cffc39d26fdd6e05)", + "bee-runtime", + "bee-storage", + "chrono", + "flume", + "futures", + "log", + "reqwest", + "serde 1.0.124", + "thiserror", + "tokio", +] + [[package]] name = "bee-snapshot" version = "0.1.0-alpha" @@ -457,7 +611,7 @@ source = "git+https://github.com/iotaledger/bee.git?rev=d379dc3f6d96bca53c32e53f dependencies = [ "async-trait", "bee-common 0.3.1-alpha (git+https://github.com/iotaledger/bee.git?branch=dev)", - "bee-message", + "bee-message 0.1.0-alpha (git+https://github.com/iotaledger/bee.git?rev=d379dc3f6d96bca53c32e53feb3e6b7a0a7372b4)", "bee-runtime", "bee-storage", "chrono", @@ -480,6 +634,30 @@ dependencies = [ "serde 1.0.124", ] +[[package]] +name = "bee-tangle" +version = "0.1.0-alpha" +source = "git+https://github.com/iotaledger/bee.git?rev=26215e3af88af4c54f460df7cffc39d26fdd6e05#26215e3af88af4c54f460df7cffc39d26fdd6e05" +dependencies = [ + "async-trait", + "bee-common 0.3.1-alpha (git+https://github.com/iotaledger/bee.git?branch=dev)", + "bee-message 0.1.0-alpha (git+https://github.com/iotaledger/bee.git?rev=26215e3af88af4c54f460df7cffc39d26fdd6e05)", + "bee-runtime", + "bee-snapshot 0.1.0-alpha (git+https://github.com/iotaledger/bee.git?rev=26215e3af88af4c54f460df7cffc39d26fdd6e05)", + "bee-storage", + "bitflags", + "dashmap 4.0.2", + "futures", + "hashbrown 0.11.0", + "log", + "lru", + "rand 0.8.3", + "ref-cast", + "serde 1.0.124", + "thiserror", + "tokio", +] + [[package]] name = "bee-tangle" version = "0.1.0-alpha" @@ -487,14 +665,14 @@ source = "git+https://github.com/iotaledger/bee.git?rev=d379dc3f6d96bca53c32e53f dependencies = [ "async-trait", "bee-common 0.3.1-alpha (git+https://github.com/iotaledger/bee.git?branch=dev)", - "bee-message", + "bee-message 0.1.0-alpha (git+https://github.com/iotaledger/bee.git?rev=d379dc3f6d96bca53c32e53feb3e6b7a0a7372b4)", "bee-runtime", - "bee-snapshot", + "bee-snapshot 0.1.0-alpha (git+https://github.com/iotaledger/bee.git?rev=d379dc3f6d96bca53c32e53feb3e6b7a0a7372b4)", "bee-storage", "bitflags", "dashmap 4.0.2", "futures", - "hashbrown", + "hashbrown 0.9.1", "log", "lru", "rand 0.8.3", @@ -1310,13 +1488,22 @@ dependencies = [ "ahash 0.4.7", ] +[[package]] +name = "hashbrown" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "362385356d610bd1e5a408ddf8d022041774b683f345a1d2cfcb4f60f8ae2db5" +dependencies = [ + "ahash 0.7.2", +] + [[package]] name = "hashlink" version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d99cf782f0dc4372d26846bec3de7804ceb5df083c2d4462c0b8d2330e894fa8" dependencies = [ - "hashbrown", + "hashbrown 0.9.1", ] [[package]] @@ -1549,7 +1736,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "824845a0bf897a9042383849b02c1bc219c2383772efcd5c6f9766fa4b81aef3" dependencies = [ "autocfg", - "hashbrown", + "hashbrown 0.9.1", ] [[package]] @@ -1578,9 +1765,9 @@ dependencies = [ "async-trait", "bee-common 0.3.1-alpha (git+https://github.com/iotaledger/bee.git?branch=dev)", "bee-crypto 0.2.0-alpha (git+https://github.com/iotaledger/bee.git?rev=c42171ff33c80cc2efb183e244dc79b7f58d9ac4)", - "bee-message", - "bee-pow", - "bee-rest-api", + "bee-message 0.1.0-alpha (git+https://github.com/iotaledger/bee.git?rev=d379dc3f6d96bca53c32e53feb3e6b7a0a7372b4)", + "bee-pow 0.1.0-alpha (git+https://github.com/iotaledger/bee.git?rev=d379dc3f6d96bca53c32e53feb3e6b7a0a7372b4)", + "bee-rest-api 0.1.0-alpha (git+https://github.com/iotaledger/bee.git?rev=d379dc3f6d96bca53c32e53feb3e6b7a0a7372b4)", "chrono", "futures", "hex", @@ -1600,14 +1787,14 @@ dependencies = [ [[package]] name = "iota-client" version = "0.5.0-alpha.3" -source = "git+https://github.com/iotaledger/iota.rs?branch=dev#a97eebc7f9db3b629010eca5eebaa11eb25e824e" +source = "git+https://github.com/iotaledger/iota.rs?branch=dev#f837a9df7c0f3cecbff87eb6ac3d458d1e50dee0" dependencies = [ "async-trait", "bee-common 0.3.1-alpha (git+https://github.com/iotaledger/bee.git?branch=dev)", "bee-crypto 0.2.0-alpha (git+https://github.com/iotaledger/bee.git?rev=c42171ff33c80cc2efb183e244dc79b7f58d9ac4)", - "bee-message", - "bee-pow", - "bee-rest-api", + "bee-message 0.1.0-alpha (git+https://github.com/iotaledger/bee.git?rev=26215e3af88af4c54f460df7cffc39d26fdd6e05)", + "bee-pow 0.1.0-alpha (git+https://github.com/iotaledger/bee.git?rev=26215e3af88af4c54f460df7cffc39d26fdd6e05)", + "bee-rest-api 0.1.0-alpha (git+https://github.com/iotaledger/bee.git?rev=26215e3af88af4c54f460df7cffc39d26fdd6e05)", "chrono", "hex", "iota-crypto 0.3.0 (git+https://github.com/iotaledger/crypto.rs?rev=b849861b86c3f7357b7477de4253b7352b363627)", @@ -1627,19 +1814,19 @@ version = "0.2.0-alpha.3" source = "git+https://github.com/iotaledger/iota.rs?rev=1554893c01d37ef067a4d7559e33a0da48401cac#1554893c01d37ef067a4d7559e33a0da48401cac" dependencies = [ "bee-common 0.3.1-alpha (git+https://github.com/iotaledger/bee.git?rev=c42171ff33c80cc2efb183e244dc79b7f58d9ac4)", - "bee-message", - "bee-pow", + "bee-message 0.1.0-alpha (git+https://github.com/iotaledger/bee.git?rev=d379dc3f6d96bca53c32e53feb3e6b7a0a7372b4)", + "bee-pow 0.1.0-alpha (git+https://github.com/iotaledger/bee.git?rev=d379dc3f6d96bca53c32e53feb3e6b7a0a7372b4)", "iota-client 0.5.0-alpha.3 (git+https://github.com/iotaledger/iota.rs?rev=1554893c01d37ef067a4d7559e33a0da48401cac)", ] [[package]] name = "iota-core" version = "0.2.0-alpha.3" -source = "git+https://github.com/iotaledger/iota.rs?branch=dev#a97eebc7f9db3b629010eca5eebaa11eb25e824e" +source = "git+https://github.com/iotaledger/iota.rs?branch=dev#f837a9df7c0f3cecbff87eb6ac3d458d1e50dee0" dependencies = [ "bee-common 0.3.1-alpha (git+https://github.com/iotaledger/bee.git?rev=c42171ff33c80cc2efb183e244dc79b7f58d9ac4)", - "bee-message", - "bee-pow", + "bee-message 0.1.0-alpha (git+https://github.com/iotaledger/bee.git?rev=26215e3af88af4c54f460df7cffc39d26fdd6e05)", + "bee-pow 0.1.0-alpha (git+https://github.com/iotaledger/bee.git?rev=26215e3af88af4c54f460df7cffc39d26fdd6e05)", "iota-client 0.5.0-alpha.3 (git+https://github.com/iotaledger/iota.rs?branch=dev)", ] @@ -1698,7 +1885,7 @@ dependencies = [ [[package]] name = "iota-wallet" version = "0.1.0" -source = "git+https://github.com/iotaledger/wallet.rs?branch=develop#3db43cd4405ae2a421b61a12d6869219d6111271" +source = "git+https://github.com/iotaledger/wallet.rs?branch=develop#6fed1e6e14087b3d72956e143bbd8f21fe927ba5" dependencies = [ "async-trait", "backtrace", @@ -2045,7 +2232,7 @@ version = "0.6.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1f374d42cdfc1d7dbf3d3dec28afab2eb97ffbf43a3234d795b5986dbf4b90ba" dependencies = [ - "hashbrown", + "hashbrown 0.9.1", ] [[package]] From 81360ee80b54d2e3c7e2a676da030a00dbdeded5 Mon Sep 17 00:00:00 2001 From: Lucas Nogueira Date: Wed, 17 Mar 2021 17:54:13 -0300 Subject: [PATCH 04/14] chore: update wallet.rs --- .../backend/bindings/node/native/Cargo.lock | 465 ++---------------- 1 file changed, 43 insertions(+), 422 deletions(-) diff --git a/packages/backend/bindings/node/native/Cargo.lock b/packages/backend/bindings/node/native/Cargo.lock index fb2b356cc14..80af8c0adc4 100644 --- a/packages/backend/bindings/node/native/Cargo.lock +++ b/packages/backend/bindings/node/native/Cargo.lock @@ -279,7 +279,7 @@ dependencies = [ [[package]] name = "bee-common" version = "0.3.1-alpha" -source = "git+https://github.com/iotaledger/bee.git?branch=dev#1028da0cd374e74bf8091648d5fe5e9d445fe3fe" +source = "git+https://github.com/iotaledger/bee.git?branch=dev#14afcaf3df55b8dbb85372801caefd5071363a42" dependencies = [ "autocfg", "chrono", @@ -304,7 +304,7 @@ dependencies = [ [[package]] name = "bee-crypto" version = "0.2.0-alpha" -source = "git+https://github.com/iotaledger/bee.git?branch=dev#1028da0cd374e74bf8091648d5fe5e9d445fe3fe" +source = "git+https://github.com/iotaledger/bee.git?branch=dev#14afcaf3df55b8dbb85372801caefd5071363a42" dependencies = [ "bee-ternary 0.4.1-alpha", "byteorder", @@ -321,37 +321,11 @@ dependencies = [ "async-trait", "bee-common 0.3.1-alpha (git+https://github.com/iotaledger/bee.git?branch=dev)", "bee-crypto 0.2.0-alpha (git+https://github.com/iotaledger/bee.git?branch=dev)", - "bee-message 0.1.0-alpha (git+https://github.com/iotaledger/bee.git?rev=26215e3af88af4c54f460df7cffc39d26fdd6e05)", + "bee-message", "bee-runtime", - "bee-snapshot 0.1.0-alpha (git+https://github.com/iotaledger/bee.git?rev=26215e3af88af4c54f460df7cffc39d26fdd6e05)", + "bee-snapshot", "bee-storage", - "bee-tangle 0.1.0-alpha (git+https://github.com/iotaledger/bee.git?rev=26215e3af88af4c54f460df7cffc39d26fdd6e05)", - "bee-ternary 0.4.1-alpha", - "digest 0.9.0", - "flume", - "futures", - "hex", - "iota-crypto 0.3.0 (git+https://github.com/iotaledger/crypto.rs?rev=c3bf565eba62d0b81144174c2ff917bfde282e49)", - "log", - "serde 1.0.124", - "thiserror", - "tokio", - "tokio-stream", -] - -[[package]] -name = "bee-ledger" -version = "0.1.0-alpha" -source = "git+https://github.com/iotaledger/bee.git?rev=d379dc3f6d96bca53c32e53feb3e6b7a0a7372b4#d379dc3f6d96bca53c32e53feb3e6b7a0a7372b4" -dependencies = [ - "async-trait", - "bee-common 0.3.1-alpha (git+https://github.com/iotaledger/bee.git?branch=dev)", - "bee-crypto 0.2.0-alpha (git+https://github.com/iotaledger/bee.git?branch=dev)", - "bee-message 0.1.0-alpha (git+https://github.com/iotaledger/bee.git?rev=d379dc3f6d96bca53c32e53feb3e6b7a0a7372b4)", - "bee-runtime", - "bee-snapshot 0.1.0-alpha (git+https://github.com/iotaledger/bee.git?rev=d379dc3f6d96bca53c32e53feb3e6b7a0a7372b4)", - "bee-storage", - "bee-tangle 0.1.0-alpha (git+https://github.com/iotaledger/bee.git?rev=d379dc3f6d96bca53c32e53feb3e6b7a0a7372b4)", + "bee-tangle", "bee-ternary 0.4.1-alpha", "digest 0.9.0", "flume", @@ -372,23 +346,7 @@ source = "git+https://github.com/iotaledger/bee.git?rev=26215e3af88af4c54f460df7 dependencies = [ "bech32", "bee-common 0.3.1-alpha (git+https://github.com/iotaledger/bee.git?branch=dev)", - "bee-pow 0.1.0-alpha (git+https://github.com/iotaledger/bee.git?rev=26215e3af88af4c54f460df7cffc39d26fdd6e05)", - "digest 0.9.0", - "hex", - "iota-crypto 0.3.0 (git+https://github.com/iotaledger/crypto.rs?rev=c3bf565eba62d0b81144174c2ff917bfde282e49)", - "ref-cast", - "serde 1.0.124", - "thiserror", -] - -[[package]] -name = "bee-message" -version = "0.1.0-alpha" -source = "git+https://github.com/iotaledger/bee.git?rev=d379dc3f6d96bca53c32e53feb3e6b7a0a7372b4#d379dc3f6d96bca53c32e53feb3e6b7a0a7372b4" -dependencies = [ - "bech32", - "bee-common 0.3.1-alpha (git+https://github.com/iotaledger/bee.git?branch=dev)", - "bee-pow 0.1.0-alpha (git+https://github.com/iotaledger/bee.git?rev=d379dc3f6d96bca53c32e53feb3e6b7a0a7372b4)", + "bee-pow", "digest 0.9.0", "hex", "iota-crypto 0.3.0 (git+https://github.com/iotaledger/crypto.rs?rev=c3bf565eba62d0b81144174c2ff917bfde282e49)", @@ -416,25 +374,6 @@ dependencies = [ "url", ] -[[package]] -name = "bee-network" -version = "0.1.0-alpha" -source = "git+https://github.com/iotaledger/bee.git?rev=d379dc3f6d96bca53c32e53feb3e6b7a0a7372b4#d379dc3f6d96bca53c32e53feb3e6b7a0a7372b4" -dependencies = [ - "async-trait", - "bee-runtime", - "futures", - "lazy_static", - "libp2p", - "log", - "rand 0.8.3", - "serde 1.0.124", - "thiserror", - "tokio", - "tokio-stream", - "url", -] - [[package]] name = "bee-pow" version = "0.1.0-alpha" @@ -446,17 +385,6 @@ dependencies = [ "thiserror", ] -[[package]] -name = "bee-pow" -version = "0.1.0-alpha" -source = "git+https://github.com/iotaledger/bee.git?rev=d379dc3f6d96bca53c32e53feb3e6b7a0a7372b4#d379dc3f6d96bca53c32e53feb3e6b7a0a7372b4" -dependencies = [ - "bee-crypto 0.2.0-alpha (git+https://github.com/iotaledger/bee.git?branch=dev)", - "bee-ternary 0.4.1-alpha", - "iota-crypto 0.3.0 (git+https://github.com/iotaledger/crypto.rs?rev=c3bf565eba62d0b81144174c2ff917bfde282e49)", - "thiserror", -] - [[package]] name = "bee-protocol" version = "0.1.0-alpha" @@ -467,49 +395,13 @@ dependencies = [ "async-trait", "bee-common 0.3.1-alpha (git+https://github.com/iotaledger/bee.git?branch=dev)", "bee-crypto 0.2.0-alpha (git+https://github.com/iotaledger/bee.git?branch=dev)", - "bee-ledger 0.1.0-alpha (git+https://github.com/iotaledger/bee.git?rev=26215e3af88af4c54f460df7cffc39d26fdd6e05)", - "bee-message 0.1.0-alpha (git+https://github.com/iotaledger/bee.git?rev=26215e3af88af4c54f460df7cffc39d26fdd6e05)", - "bee-network 0.1.0-alpha (git+https://github.com/iotaledger/bee.git?rev=26215e3af88af4c54f460df7cffc39d26fdd6e05)", - "bee-runtime", - "bee-snapshot 0.1.0-alpha (git+https://github.com/iotaledger/bee.git?rev=26215e3af88af4c54f460df7cffc39d26fdd6e05)", - "bee-storage", - "bee-tangle 0.1.0-alpha (git+https://github.com/iotaledger/bee.git?rev=26215e3af88af4c54f460df7cffc39d26fdd6e05)", - "bee-ternary 0.4.1-alpha", - "futures", - "futures-util", - "fxhash", - "hex", - "iota-crypto 0.3.0 (git+https://github.com/iotaledger/crypto.rs?rev=c3bf565eba62d0b81144174c2ff917bfde282e49)", - "log", - "num_cpus", - "pin-project 1.0.5", - "rand 0.8.3", - "ref-cast", - "serde 1.0.124", - "spin 0.7.1", - "thiserror", - "tokio", - "tokio-stream", - "twox-hash", -] - -[[package]] -name = "bee-protocol" -version = "0.1.0-alpha" -source = "git+https://github.com/iotaledger/bee.git?rev=d379dc3f6d96bca53c32e53feb3e6b7a0a7372b4#d379dc3f6d96bca53c32e53feb3e6b7a0a7372b4" -dependencies = [ - "async-channel", - "async-priority-queue", - "async-trait", - "bee-common 0.3.1-alpha (git+https://github.com/iotaledger/bee.git?branch=dev)", - "bee-crypto 0.2.0-alpha (git+https://github.com/iotaledger/bee.git?branch=dev)", - "bee-ledger 0.1.0-alpha (git+https://github.com/iotaledger/bee.git?rev=d379dc3f6d96bca53c32e53feb3e6b7a0a7372b4)", - "bee-message 0.1.0-alpha (git+https://github.com/iotaledger/bee.git?rev=d379dc3f6d96bca53c32e53feb3e6b7a0a7372b4)", - "bee-network 0.1.0-alpha (git+https://github.com/iotaledger/bee.git?rev=d379dc3f6d96bca53c32e53feb3e6b7a0a7372b4)", + "bee-ledger", + "bee-message", + "bee-network", "bee-runtime", - "bee-snapshot 0.1.0-alpha (git+https://github.com/iotaledger/bee.git?rev=d379dc3f6d96bca53c32e53feb3e6b7a0a7372b4)", + "bee-snapshot", "bee-storage", - "bee-tangle 0.1.0-alpha (git+https://github.com/iotaledger/bee.git?rev=d379dc3f6d96bca53c32e53feb3e6b7a0a7372b4)", + "bee-tangle", "bee-ternary 0.4.1-alpha", "futures", "futures-util", @@ -534,48 +426,20 @@ name = "bee-rest-api" version = "0.1.0-alpha" source = "git+https://github.com/iotaledger/bee.git?rev=26215e3af88af4c54f460df7cffc39d26fdd6e05#26215e3af88af4c54f460df7cffc39d26fdd6e05" dependencies = [ - "bee-ledger 0.1.0-alpha (git+https://github.com/iotaledger/bee.git?rev=26215e3af88af4c54f460df7cffc39d26fdd6e05)", - "bee-message 0.1.0-alpha (git+https://github.com/iotaledger/bee.git?rev=26215e3af88af4c54f460df7cffc39d26fdd6e05)", - "bee-pow 0.1.0-alpha (git+https://github.com/iotaledger/bee.git?rev=26215e3af88af4c54f460df7cffc39d26fdd6e05)", - "bee-protocol 0.1.0-alpha (git+https://github.com/iotaledger/bee.git?rev=26215e3af88af4c54f460df7cffc39d26fdd6e05)", - "bee-runtime", - "hex", - "serde 1.0.124", - "serde_json", -] - -[[package]] -name = "bee-rest-api" -version = "0.1.0-alpha" -source = "git+https://github.com/iotaledger/bee.git?rev=d379dc3f6d96bca53c32e53feb3e6b7a0a7372b4#d379dc3f6d96bca53c32e53feb3e6b7a0a7372b4" -dependencies = [ - "async-trait", - "bech32", - "bee-common 0.3.1-alpha (git+https://github.com/iotaledger/bee.git?branch=dev)", - "bee-ledger 0.1.0-alpha (git+https://github.com/iotaledger/bee.git?rev=d379dc3f6d96bca53c32e53feb3e6b7a0a7372b4)", - "bee-message 0.1.0-alpha (git+https://github.com/iotaledger/bee.git?rev=d379dc3f6d96bca53c32e53feb3e6b7a0a7372b4)", - "bee-network 0.1.0-alpha (git+https://github.com/iotaledger/bee.git?rev=d379dc3f6d96bca53c32e53feb3e6b7a0a7372b4)", - "bee-pow 0.1.0-alpha (git+https://github.com/iotaledger/bee.git?rev=d379dc3f6d96bca53c32e53feb3e6b7a0a7372b4)", - "bee-protocol 0.1.0-alpha (git+https://github.com/iotaledger/bee.git?rev=d379dc3f6d96bca53c32e53feb3e6b7a0a7372b4)", + "bee-ledger", + "bee-message", + "bee-pow", + "bee-protocol", "bee-runtime", - "bee-storage", - "bee-tangle 0.1.0-alpha (git+https://github.com/iotaledger/bee.git?rev=d379dc3f6d96bca53c32e53feb3e6b7a0a7372b4)", - "digest 0.9.0", - "futures", "hex", - "iota-crypto 0.3.0 (git+https://github.com/iotaledger/crypto.rs?rev=c3bf565eba62d0b81144174c2ff917bfde282e49)", - "log", - "num_cpus", "serde 1.0.124", "serde_json", - "tokio", - "warp", ] [[package]] name = "bee-runtime" version = "0.1.1-alpha" -source = "git+https://github.com/iotaledger/bee.git?branch=dev#1028da0cd374e74bf8091648d5fe5e9d445fe3fe" +source = "git+https://github.com/iotaledger/bee.git?branch=dev#14afcaf3df55b8dbb85372801caefd5071363a42" dependencies = [ "async-trait", "bee-storage", @@ -591,27 +455,7 @@ source = "git+https://github.com/iotaledger/bee.git?rev=26215e3af88af4c54f460df7 dependencies = [ "async-trait", "bee-common 0.3.1-alpha (git+https://github.com/iotaledger/bee.git?branch=dev)", - "bee-message 0.1.0-alpha (git+https://github.com/iotaledger/bee.git?rev=26215e3af88af4c54f460df7cffc39d26fdd6e05)", - "bee-runtime", - "bee-storage", - "chrono", - "flume", - "futures", - "log", - "reqwest", - "serde 1.0.124", - "thiserror", - "tokio", -] - -[[package]] -name = "bee-snapshot" -version = "0.1.0-alpha" -source = "git+https://github.com/iotaledger/bee.git?rev=d379dc3f6d96bca53c32e53feb3e6b7a0a7372b4#d379dc3f6d96bca53c32e53feb3e6b7a0a7372b4" -dependencies = [ - "async-trait", - "bee-common 0.3.1-alpha (git+https://github.com/iotaledger/bee.git?branch=dev)", - "bee-message 0.1.0-alpha (git+https://github.com/iotaledger/bee.git?rev=d379dc3f6d96bca53c32e53feb3e6b7a0a7372b4)", + "bee-message", "bee-runtime", "bee-storage", "chrono", @@ -627,7 +471,7 @@ dependencies = [ [[package]] name = "bee-storage" version = "0.2.0-alpha" -source = "git+https://github.com/iotaledger/bee.git?branch=dev#1028da0cd374e74bf8091648d5fe5e9d445fe3fe" +source = "git+https://github.com/iotaledger/bee.git?branch=dev#14afcaf3df55b8dbb85372801caefd5071363a42" dependencies = [ "async-trait", "futures", @@ -641,9 +485,9 @@ source = "git+https://github.com/iotaledger/bee.git?rev=26215e3af88af4c54f460df7 dependencies = [ "async-trait", "bee-common 0.3.1-alpha (git+https://github.com/iotaledger/bee.git?branch=dev)", - "bee-message 0.1.0-alpha (git+https://github.com/iotaledger/bee.git?rev=26215e3af88af4c54f460df7cffc39d26fdd6e05)", + "bee-message", "bee-runtime", - "bee-snapshot 0.1.0-alpha (git+https://github.com/iotaledger/bee.git?rev=26215e3af88af4c54f460df7cffc39d26fdd6e05)", + "bee-snapshot", "bee-storage", "bitflags", "dashmap 4.0.2", @@ -658,30 +502,6 @@ dependencies = [ "tokio", ] -[[package]] -name = "bee-tangle" -version = "0.1.0-alpha" -source = "git+https://github.com/iotaledger/bee.git?rev=d379dc3f6d96bca53c32e53feb3e6b7a0a7372b4#d379dc3f6d96bca53c32e53feb3e6b7a0a7372b4" -dependencies = [ - "async-trait", - "bee-common 0.3.1-alpha (git+https://github.com/iotaledger/bee.git?branch=dev)", - "bee-message 0.1.0-alpha (git+https://github.com/iotaledger/bee.git?rev=d379dc3f6d96bca53c32e53feb3e6b7a0a7372b4)", - "bee-runtime", - "bee-snapshot 0.1.0-alpha (git+https://github.com/iotaledger/bee.git?rev=d379dc3f6d96bca53c32e53feb3e6b7a0a7372b4)", - "bee-storage", - "bitflags", - "dashmap 4.0.2", - "futures", - "hashbrown 0.9.1", - "log", - "lru", - "rand 0.8.3", - "ref-cast", - "serde 1.0.124", - "thiserror", - "tokio", -] - [[package]] name = "bee-ternary" version = "0.4.0-alpha" @@ -694,7 +514,7 @@ dependencies = [ [[package]] name = "bee-ternary" version = "0.4.1-alpha" -source = "git+https://github.com/iotaledger/bee.git?branch=dev#1028da0cd374e74bf8091648d5fe5e9d445fe3fe" +source = "git+https://github.com/iotaledger/bee.git?branch=dev#14afcaf3df55b8dbb85372801caefd5071363a42" dependencies = [ "autocfg", "num-traits 0.2.14", @@ -772,16 +592,6 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "771fe0050b883fcc3ea2359b1a96bcfbc090b7116eae7c3c512c7a083fdf23d3" -[[package]] -name = "buf_redux" -version = "0.8.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b953a6887648bb07a535631f2bc00fbdb2a2216f135552cb3f534ed136b9c07f" -dependencies = [ - "memchr", - "safemem", -] - [[package]] name = "bumpalo" version = "3.6.1" @@ -1506,31 +1316,6 @@ dependencies = [ "hashbrown 0.9.1", ] -[[package]] -name = "headers" -version = "0.3.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0b7591fb62902706ae8e7aaff416b1b0fa2c0fd0878b46dc13baa3712d8a855" -dependencies = [ - "base64", - "bitflags", - "bytes", - "headers-core", - "http", - "mime", - "sha-1", - "time", -] - -[[package]] -name = "headers-core" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7f66481bfee273957b1f20485a4ff3362987f85b2c236580d81b4eb7a326429" -dependencies = [ - "http", -] - [[package]] name = "heck" version = "0.3.2" @@ -1739,15 +1524,6 @@ dependencies = [ "hashbrown 0.9.1", ] -[[package]] -name = "input_buffer" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f97967975f448f1a7ddb12b0bc41069d09ed6a1c161a92687e057325db35d413" -dependencies = [ - "bytes", -] - [[package]] name = "instant" version = "0.1.9" @@ -1760,18 +1536,19 @@ dependencies = [ [[package]] name = "iota-client" version = "0.5.0-alpha.3" -source = "git+https://github.com/iotaledger/iota.rs?rev=1554893c01d37ef067a4d7559e33a0da48401cac#1554893c01d37ef067a4d7559e33a0da48401cac" +source = "git+https://github.com/iotaledger/iota.rs?rev=f837a9df7c0f3cecbff87eb6ac3d458d1e50dee0#f837a9df7c0f3cecbff87eb6ac3d458d1e50dee0" dependencies = [ "async-trait", "bee-common 0.3.1-alpha (git+https://github.com/iotaledger/bee.git?branch=dev)", "bee-crypto 0.2.0-alpha (git+https://github.com/iotaledger/bee.git?rev=c42171ff33c80cc2efb183e244dc79b7f58d9ac4)", - "bee-message 0.1.0-alpha (git+https://github.com/iotaledger/bee.git?rev=d379dc3f6d96bca53c32e53feb3e6b7a0a7372b4)", - "bee-pow 0.1.0-alpha (git+https://github.com/iotaledger/bee.git?rev=d379dc3f6d96bca53c32e53feb3e6b7a0a7372b4)", - "bee-rest-api 0.1.0-alpha (git+https://github.com/iotaledger/bee.git?rev=d379dc3f6d96bca53c32e53feb3e6b7a0a7372b4)", + "bee-message", + "bee-pow", + "bee-rest-api", "chrono", "futures", "hex", "iota-crypto 0.3.0 (git+https://github.com/iotaledger/crypto.rs?rev=b849861b86c3f7357b7477de4253b7352b363627)", + "log", "num_cpus", "once_cell", "regex", @@ -1787,14 +1564,14 @@ dependencies = [ [[package]] name = "iota-client" version = "0.5.0-alpha.3" -source = "git+https://github.com/iotaledger/iota.rs?branch=dev#f837a9df7c0f3cecbff87eb6ac3d458d1e50dee0" +source = "git+https://github.com/iotaledger/iota.rs?branch=dev#527a5d833bacfeac1ad67cd1989eed7686cedc75" dependencies = [ "async-trait", "bee-common 0.3.1-alpha (git+https://github.com/iotaledger/bee.git?branch=dev)", "bee-crypto 0.2.0-alpha (git+https://github.com/iotaledger/bee.git?rev=c42171ff33c80cc2efb183e244dc79b7f58d9ac4)", - "bee-message 0.1.0-alpha (git+https://github.com/iotaledger/bee.git?rev=26215e3af88af4c54f460df7cffc39d26fdd6e05)", - "bee-pow 0.1.0-alpha (git+https://github.com/iotaledger/bee.git?rev=26215e3af88af4c54f460df7cffc39d26fdd6e05)", - "bee-rest-api 0.1.0-alpha (git+https://github.com/iotaledger/bee.git?rev=26215e3af88af4c54f460df7cffc39d26fdd6e05)", + "bee-message", + "bee-pow", + "bee-rest-api", "chrono", "hex", "iota-crypto 0.3.0 (git+https://github.com/iotaledger/crypto.rs?rev=b849861b86c3f7357b7477de4253b7352b363627)", @@ -1811,22 +1588,22 @@ dependencies = [ [[package]] name = "iota-core" version = "0.2.0-alpha.3" -source = "git+https://github.com/iotaledger/iota.rs?rev=1554893c01d37ef067a4d7559e33a0da48401cac#1554893c01d37ef067a4d7559e33a0da48401cac" +source = "git+https://github.com/iotaledger/iota.rs?rev=f837a9df7c0f3cecbff87eb6ac3d458d1e50dee0#f837a9df7c0f3cecbff87eb6ac3d458d1e50dee0" dependencies = [ "bee-common 0.3.1-alpha (git+https://github.com/iotaledger/bee.git?rev=c42171ff33c80cc2efb183e244dc79b7f58d9ac4)", - "bee-message 0.1.0-alpha (git+https://github.com/iotaledger/bee.git?rev=d379dc3f6d96bca53c32e53feb3e6b7a0a7372b4)", - "bee-pow 0.1.0-alpha (git+https://github.com/iotaledger/bee.git?rev=d379dc3f6d96bca53c32e53feb3e6b7a0a7372b4)", - "iota-client 0.5.0-alpha.3 (git+https://github.com/iotaledger/iota.rs?rev=1554893c01d37ef067a4d7559e33a0da48401cac)", + "bee-message", + "bee-pow", + "iota-client 0.5.0-alpha.3 (git+https://github.com/iotaledger/iota.rs?rev=f837a9df7c0f3cecbff87eb6ac3d458d1e50dee0)", ] [[package]] name = "iota-core" version = "0.2.0-alpha.3" -source = "git+https://github.com/iotaledger/iota.rs?branch=dev#f837a9df7c0f3cecbff87eb6ac3d458d1e50dee0" +source = "git+https://github.com/iotaledger/iota.rs?branch=dev#527a5d833bacfeac1ad67cd1989eed7686cedc75" dependencies = [ "bee-common 0.3.1-alpha (git+https://github.com/iotaledger/bee.git?rev=c42171ff33c80cc2efb183e244dc79b7f58d9ac4)", - "bee-message 0.1.0-alpha (git+https://github.com/iotaledger/bee.git?rev=26215e3af88af4c54f460df7cffc39d26fdd6e05)", - "bee-pow 0.1.0-alpha (git+https://github.com/iotaledger/bee.git?rev=26215e3af88af4c54f460df7cffc39d26fdd6e05)", + "bee-message", + "bee-pow", "iota-client 0.5.0-alpha.3 (git+https://github.com/iotaledger/iota.rs?branch=dev)", ] @@ -1885,7 +1662,7 @@ dependencies = [ [[package]] name = "iota-wallet" version = "0.1.0" -source = "git+https://github.com/iotaledger/wallet.rs?branch=develop#6fed1e6e14087b3d72956e143bbd8f21fe927ba5" +source = "git+https://github.com/iotaledger/wallet.rs?branch=develop#21099e5a0a6bbcd2e266f631d7af72d6b9c41f1a" dependencies = [ "async-trait", "backtrace", @@ -1894,7 +1671,7 @@ dependencies = [ "futures", "getset", "hex", - "iota-core 0.2.0-alpha.3 (git+https://github.com/iotaledger/iota.rs?rev=1554893c01d37ef067a4d7559e33a0da48401cac)", + "iota-core 0.2.0-alpha.3 (git+https://github.com/iotaledger/iota.rs?rev=f837a9df7c0f3cecbff87eb6ac3d458d1e50dee0)", "iota-crypto 0.3.0 (git+https://github.com/iotaledger/crypto.rs?rev=b849861b86c3f7357b7477de4253b7352b363627)", "iota-stronghold", "log", @@ -2253,16 +2030,6 @@ version = "0.3.16" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2a60c7ce501c71e03a9c9c0d35b861413ae925bd979cc7a4e30d060069aaac8d" -[[package]] -name = "mime_guess" -version = "2.0.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2684d4c2e97d99848d30b324b00c8fcc7e5c897b7cbb5819b09e7c90e8baf212" -dependencies = [ - "mime", - "unicase", -] - [[package]] name = "miniz_oxide" version = "0.4.4" @@ -2338,24 +2105,6 @@ version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e5ce46fe64a9d73be07dcbe690a38ce1b293be448fd8ce1e6c1b8062c9f72c6a" -[[package]] -name = "multipart" -version = "0.17.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d050aeedc89243f5347c3e237e3e13dc76fbe4ae3742a57b94dc14f69acf76d4" -dependencies = [ - "buf_redux", - "httparse", - "log", - "mime", - "mime_guess", - "quick-error", - "rand 0.7.3", - "safemem", - "tempfile", - "twoway", -] - [[package]] name = "multistream-select" version = "0.10.2" @@ -2589,9 +2338,9 @@ dependencies = [ [[package]] name = "parity-multiaddr" -version = "0.11.1" +version = "0.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d2c6805f98667a3828afb2ec2c396a8d610497e8d546f5447188aae47c5a79ec" +checksum = "58341485071825827b7f03cf7efd1cb21e6a709bea778fb50227fd45d2f361b4" dependencies = [ "arrayref", "bs58", @@ -2644,9 +2393,9 @@ checksum = "acbf547ad0c65e31259204bd90935776d1c693cec2f4ff7abb7a1bbbd40dfe58" [[package]] name = "pbkdf2" -version = "0.7.3" +version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "309c95c5f738c85920eb7062a2de29f3840d4f96974453fc9ac1ba078da9c627" +checksum = "297e1dad0e9de7af53235b833761351bf6bda57d6acb4f263b61a2ddf674f1dc" dependencies = [ "crypto-mac 0.10.0", ] @@ -2894,12 +2643,6 @@ dependencies = [ "percent-encoding", ] -[[package]] -name = "quick-error" -version = "1.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1d01941d82fa2ab50be1e79e6714289dd7cde78eba4c074bc5a4374f650dfe0" - [[package]] name = "quote" version = "0.6.13" @@ -3243,12 +2986,6 @@ version = "1.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "71d301d4193d031abdd79ff7e3dd721168a9572ef3fe51a1517aba235bd8f86e" -[[package]] -name = "safemem" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef703b7cb59335eae2eb93ceb664c0eb7ea6bf567079d843e09420219668e072" - [[package]] name = "schannel" version = "0.1.19" @@ -3259,12 +2996,6 @@ dependencies = [ "winapi", ] -[[package]] -name = "scoped-tls" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea6a9290e3c9cf0f18145ef7ffa62d68ee0bf5fcd651017e586dc7fd5da448c2" - [[package]] name = "scopeguard" version = "1.1.0" @@ -3401,19 +3132,6 @@ dependencies = [ "serde 1.0.124", ] -[[package]] -name = "sha-1" -version = "0.9.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dfebf75d25bd900fd1e7d11501efab59bc846dbc76196839663e6637bba9f25f" -dependencies = [ - "block-buffer 0.9.0", - "cfg-if 1.0.0", - "cpuid-bool 0.1.2", - "digest 0.9.0", - "opaque-debug 0.3.0", -] - [[package]] name = "sha2" version = "0.8.2" @@ -3790,19 +3508,6 @@ dependencies = [ "tokio", ] -[[package]] -name = "tokio-tungstenite" -version = "0.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e1a5f475f1b9d077ea1017ecbc60890fda8e54942d680ca0b1d2b47cfa2d861b" -dependencies = [ - "futures-util", - "log", - "pin-project 1.0.5", - "tokio", - "tungstenite", -] - [[package]] name = "tokio-util" version = "0.6.4" @@ -3839,7 +3544,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "01ebdc2bb4498ab1ab5f5b73c5803825e60199229ccba0698170e3be0e7f959f" dependencies = [ "cfg-if 1.0.0", - "log", "pin-project-lite", "tracing-core", ] @@ -3853,50 +3557,12 @@ dependencies = [ "lazy_static", ] -[[package]] -name = "tracing-futures" -version = "0.2.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97d095ae15e245a057c8e8451bab9b3ee1e1f68e9ba2b4fbc18d0ac5237835f2" -dependencies = [ - "pin-project 1.0.5", - "tracing", -] - [[package]] name = "try-lock" version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "59547bce71d9c38b83d9c0e92b6066c4253371f15005def0c30d9657f50c7642" -[[package]] -name = "tungstenite" -version = "0.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ada8297e8d70872fa9a551d93250a9f407beb9f37ef86494eb20012a2ff7c24" -dependencies = [ - "base64", - "byteorder", - "bytes", - "http", - "httparse", - "input_buffer", - "log", - "rand 0.8.3", - "sha-1", - "url", - "utf-8", -] - -[[package]] -name = "twoway" -version = "0.1.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59b11b2b5241ba34be09c3cc85a36e56e48f9888862e19cedf23336d35316ed1" -dependencies = [ - "memchr", -] - [[package]] name = "twox-hash" version = "1.6.0" @@ -3914,15 +3580,6 @@ version = "1.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "879f6906492a7cd215bfa4cf595b600146ccfac0c79bcbd1f3000162af5e8b06" -[[package]] -name = "unicase" -version = "2.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50f37be617794602aabbeee0be4f259dc1778fabe05e2d67ee8f79326d5cb4f6" -dependencies = [ - "version_check", -] - [[package]] name = "unicode-bidi" version = "0.3.4" @@ -4019,12 +3676,6 @@ dependencies = [ "serde 1.0.124", ] -[[package]] -name = "utf-8" -version = "0.7.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05e42f7c18b8f902290b009cde6d651262f956c98bc51bca4cd1d511c9cd85c7" - [[package]] name = "uuid" version = "0.8.2" @@ -4100,36 +3751,6 @@ dependencies = [ "try-lock", ] -[[package]] -name = "warp" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3dafd0aac2818a94a34df0df1100a7356c493d8ede4393875fd0b5c51bb6bc80" -dependencies = [ - "bytes", - "futures", - "headers", - "http", - "hyper", - "log", - "mime", - "mime_guess", - "multipart", - "percent-encoding", - "pin-project 1.0.5", - "scoped-tls", - "serde 1.0.124", - "serde_json", - "serde_urlencoded", - "tokio", - "tokio-stream", - "tokio-tungstenite", - "tokio-util", - "tower-service", - "tracing", - "tracing-futures", -] - [[package]] name = "wasi" version = "0.9.0+wasi-snapshot-preview1" From f7483fbbf49eeeab82fd6dc51b6f6b7bd790523d Mon Sep 17 00:00:00 2001 From: Lucas Nogueira Date: Wed, 17 Mar 2021 17:54:22 -0300 Subject: [PATCH 05/14] feat: sync spent outputs --- packages/backend/src/lib.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/backend/src/lib.rs b/packages/backend/src/lib.rs index 9ba271ffda0..55c4852a004 100644 --- a/packages/backend/src/lib.rs +++ b/packages/backend/src/lib.rs @@ -98,6 +98,7 @@ pub async fn init, F: Fn(String) + Send + Sync + 'static>( ) .unwrap() //safe to unwrap, the storage password is None ^ .with_polling_interval(Duration::from_millis(POLLING_INTERVAL_MS)) + .with_sync_spent_outputs() .finish() .await .expect("failed to init account manager"); From 0c539b6c4b9af397349dd5b3db5e8a07b9395530 Mon Sep 17 00:00:00 2001 From: Umair Sarfraz Date: Thu, 18 Mar 2021 12:38:58 +0100 Subject: [PATCH 06/14] chore: update wallet.rs --- .../backend/bindings/node/native/Cargo.lock | 465 ++---------------- 1 file changed, 43 insertions(+), 422 deletions(-) diff --git a/packages/backend/bindings/node/native/Cargo.lock b/packages/backend/bindings/node/native/Cargo.lock index fb2b356cc14..7408e2907f6 100644 --- a/packages/backend/bindings/node/native/Cargo.lock +++ b/packages/backend/bindings/node/native/Cargo.lock @@ -279,7 +279,7 @@ dependencies = [ [[package]] name = "bee-common" version = "0.3.1-alpha" -source = "git+https://github.com/iotaledger/bee.git?branch=dev#1028da0cd374e74bf8091648d5fe5e9d445fe3fe" +source = "git+https://github.com/iotaledger/bee.git?branch=dev#22c38d0046cf28258b29d0204b17e9aa573a014c" dependencies = [ "autocfg", "chrono", @@ -304,7 +304,7 @@ dependencies = [ [[package]] name = "bee-crypto" version = "0.2.0-alpha" -source = "git+https://github.com/iotaledger/bee.git?branch=dev#1028da0cd374e74bf8091648d5fe5e9d445fe3fe" +source = "git+https://github.com/iotaledger/bee.git?branch=dev#22c38d0046cf28258b29d0204b17e9aa573a014c" dependencies = [ "bee-ternary 0.4.1-alpha", "byteorder", @@ -321,37 +321,11 @@ dependencies = [ "async-trait", "bee-common 0.3.1-alpha (git+https://github.com/iotaledger/bee.git?branch=dev)", "bee-crypto 0.2.0-alpha (git+https://github.com/iotaledger/bee.git?branch=dev)", - "bee-message 0.1.0-alpha (git+https://github.com/iotaledger/bee.git?rev=26215e3af88af4c54f460df7cffc39d26fdd6e05)", + "bee-message", "bee-runtime", - "bee-snapshot 0.1.0-alpha (git+https://github.com/iotaledger/bee.git?rev=26215e3af88af4c54f460df7cffc39d26fdd6e05)", + "bee-snapshot", "bee-storage", - "bee-tangle 0.1.0-alpha (git+https://github.com/iotaledger/bee.git?rev=26215e3af88af4c54f460df7cffc39d26fdd6e05)", - "bee-ternary 0.4.1-alpha", - "digest 0.9.0", - "flume", - "futures", - "hex", - "iota-crypto 0.3.0 (git+https://github.com/iotaledger/crypto.rs?rev=c3bf565eba62d0b81144174c2ff917bfde282e49)", - "log", - "serde 1.0.124", - "thiserror", - "tokio", - "tokio-stream", -] - -[[package]] -name = "bee-ledger" -version = "0.1.0-alpha" -source = "git+https://github.com/iotaledger/bee.git?rev=d379dc3f6d96bca53c32e53feb3e6b7a0a7372b4#d379dc3f6d96bca53c32e53feb3e6b7a0a7372b4" -dependencies = [ - "async-trait", - "bee-common 0.3.1-alpha (git+https://github.com/iotaledger/bee.git?branch=dev)", - "bee-crypto 0.2.0-alpha (git+https://github.com/iotaledger/bee.git?branch=dev)", - "bee-message 0.1.0-alpha (git+https://github.com/iotaledger/bee.git?rev=d379dc3f6d96bca53c32e53feb3e6b7a0a7372b4)", - "bee-runtime", - "bee-snapshot 0.1.0-alpha (git+https://github.com/iotaledger/bee.git?rev=d379dc3f6d96bca53c32e53feb3e6b7a0a7372b4)", - "bee-storage", - "bee-tangle 0.1.0-alpha (git+https://github.com/iotaledger/bee.git?rev=d379dc3f6d96bca53c32e53feb3e6b7a0a7372b4)", + "bee-tangle", "bee-ternary 0.4.1-alpha", "digest 0.9.0", "flume", @@ -372,23 +346,7 @@ source = "git+https://github.com/iotaledger/bee.git?rev=26215e3af88af4c54f460df7 dependencies = [ "bech32", "bee-common 0.3.1-alpha (git+https://github.com/iotaledger/bee.git?branch=dev)", - "bee-pow 0.1.0-alpha (git+https://github.com/iotaledger/bee.git?rev=26215e3af88af4c54f460df7cffc39d26fdd6e05)", - "digest 0.9.0", - "hex", - "iota-crypto 0.3.0 (git+https://github.com/iotaledger/crypto.rs?rev=c3bf565eba62d0b81144174c2ff917bfde282e49)", - "ref-cast", - "serde 1.0.124", - "thiserror", -] - -[[package]] -name = "bee-message" -version = "0.1.0-alpha" -source = "git+https://github.com/iotaledger/bee.git?rev=d379dc3f6d96bca53c32e53feb3e6b7a0a7372b4#d379dc3f6d96bca53c32e53feb3e6b7a0a7372b4" -dependencies = [ - "bech32", - "bee-common 0.3.1-alpha (git+https://github.com/iotaledger/bee.git?branch=dev)", - "bee-pow 0.1.0-alpha (git+https://github.com/iotaledger/bee.git?rev=d379dc3f6d96bca53c32e53feb3e6b7a0a7372b4)", + "bee-pow", "digest 0.9.0", "hex", "iota-crypto 0.3.0 (git+https://github.com/iotaledger/crypto.rs?rev=c3bf565eba62d0b81144174c2ff917bfde282e49)", @@ -416,25 +374,6 @@ dependencies = [ "url", ] -[[package]] -name = "bee-network" -version = "0.1.0-alpha" -source = "git+https://github.com/iotaledger/bee.git?rev=d379dc3f6d96bca53c32e53feb3e6b7a0a7372b4#d379dc3f6d96bca53c32e53feb3e6b7a0a7372b4" -dependencies = [ - "async-trait", - "bee-runtime", - "futures", - "lazy_static", - "libp2p", - "log", - "rand 0.8.3", - "serde 1.0.124", - "thiserror", - "tokio", - "tokio-stream", - "url", -] - [[package]] name = "bee-pow" version = "0.1.0-alpha" @@ -446,17 +385,6 @@ dependencies = [ "thiserror", ] -[[package]] -name = "bee-pow" -version = "0.1.0-alpha" -source = "git+https://github.com/iotaledger/bee.git?rev=d379dc3f6d96bca53c32e53feb3e6b7a0a7372b4#d379dc3f6d96bca53c32e53feb3e6b7a0a7372b4" -dependencies = [ - "bee-crypto 0.2.0-alpha (git+https://github.com/iotaledger/bee.git?branch=dev)", - "bee-ternary 0.4.1-alpha", - "iota-crypto 0.3.0 (git+https://github.com/iotaledger/crypto.rs?rev=c3bf565eba62d0b81144174c2ff917bfde282e49)", - "thiserror", -] - [[package]] name = "bee-protocol" version = "0.1.0-alpha" @@ -467,49 +395,13 @@ dependencies = [ "async-trait", "bee-common 0.3.1-alpha (git+https://github.com/iotaledger/bee.git?branch=dev)", "bee-crypto 0.2.0-alpha (git+https://github.com/iotaledger/bee.git?branch=dev)", - "bee-ledger 0.1.0-alpha (git+https://github.com/iotaledger/bee.git?rev=26215e3af88af4c54f460df7cffc39d26fdd6e05)", - "bee-message 0.1.0-alpha (git+https://github.com/iotaledger/bee.git?rev=26215e3af88af4c54f460df7cffc39d26fdd6e05)", - "bee-network 0.1.0-alpha (git+https://github.com/iotaledger/bee.git?rev=26215e3af88af4c54f460df7cffc39d26fdd6e05)", - "bee-runtime", - "bee-snapshot 0.1.0-alpha (git+https://github.com/iotaledger/bee.git?rev=26215e3af88af4c54f460df7cffc39d26fdd6e05)", - "bee-storage", - "bee-tangle 0.1.0-alpha (git+https://github.com/iotaledger/bee.git?rev=26215e3af88af4c54f460df7cffc39d26fdd6e05)", - "bee-ternary 0.4.1-alpha", - "futures", - "futures-util", - "fxhash", - "hex", - "iota-crypto 0.3.0 (git+https://github.com/iotaledger/crypto.rs?rev=c3bf565eba62d0b81144174c2ff917bfde282e49)", - "log", - "num_cpus", - "pin-project 1.0.5", - "rand 0.8.3", - "ref-cast", - "serde 1.0.124", - "spin 0.7.1", - "thiserror", - "tokio", - "tokio-stream", - "twox-hash", -] - -[[package]] -name = "bee-protocol" -version = "0.1.0-alpha" -source = "git+https://github.com/iotaledger/bee.git?rev=d379dc3f6d96bca53c32e53feb3e6b7a0a7372b4#d379dc3f6d96bca53c32e53feb3e6b7a0a7372b4" -dependencies = [ - "async-channel", - "async-priority-queue", - "async-trait", - "bee-common 0.3.1-alpha (git+https://github.com/iotaledger/bee.git?branch=dev)", - "bee-crypto 0.2.0-alpha (git+https://github.com/iotaledger/bee.git?branch=dev)", - "bee-ledger 0.1.0-alpha (git+https://github.com/iotaledger/bee.git?rev=d379dc3f6d96bca53c32e53feb3e6b7a0a7372b4)", - "bee-message 0.1.0-alpha (git+https://github.com/iotaledger/bee.git?rev=d379dc3f6d96bca53c32e53feb3e6b7a0a7372b4)", - "bee-network 0.1.0-alpha (git+https://github.com/iotaledger/bee.git?rev=d379dc3f6d96bca53c32e53feb3e6b7a0a7372b4)", + "bee-ledger", + "bee-message", + "bee-network", "bee-runtime", - "bee-snapshot 0.1.0-alpha (git+https://github.com/iotaledger/bee.git?rev=d379dc3f6d96bca53c32e53feb3e6b7a0a7372b4)", + "bee-snapshot", "bee-storage", - "bee-tangle 0.1.0-alpha (git+https://github.com/iotaledger/bee.git?rev=d379dc3f6d96bca53c32e53feb3e6b7a0a7372b4)", + "bee-tangle", "bee-ternary 0.4.1-alpha", "futures", "futures-util", @@ -534,48 +426,20 @@ name = "bee-rest-api" version = "0.1.0-alpha" source = "git+https://github.com/iotaledger/bee.git?rev=26215e3af88af4c54f460df7cffc39d26fdd6e05#26215e3af88af4c54f460df7cffc39d26fdd6e05" dependencies = [ - "bee-ledger 0.1.0-alpha (git+https://github.com/iotaledger/bee.git?rev=26215e3af88af4c54f460df7cffc39d26fdd6e05)", - "bee-message 0.1.0-alpha (git+https://github.com/iotaledger/bee.git?rev=26215e3af88af4c54f460df7cffc39d26fdd6e05)", - "bee-pow 0.1.0-alpha (git+https://github.com/iotaledger/bee.git?rev=26215e3af88af4c54f460df7cffc39d26fdd6e05)", - "bee-protocol 0.1.0-alpha (git+https://github.com/iotaledger/bee.git?rev=26215e3af88af4c54f460df7cffc39d26fdd6e05)", - "bee-runtime", - "hex", - "serde 1.0.124", - "serde_json", -] - -[[package]] -name = "bee-rest-api" -version = "0.1.0-alpha" -source = "git+https://github.com/iotaledger/bee.git?rev=d379dc3f6d96bca53c32e53feb3e6b7a0a7372b4#d379dc3f6d96bca53c32e53feb3e6b7a0a7372b4" -dependencies = [ - "async-trait", - "bech32", - "bee-common 0.3.1-alpha (git+https://github.com/iotaledger/bee.git?branch=dev)", - "bee-ledger 0.1.0-alpha (git+https://github.com/iotaledger/bee.git?rev=d379dc3f6d96bca53c32e53feb3e6b7a0a7372b4)", - "bee-message 0.1.0-alpha (git+https://github.com/iotaledger/bee.git?rev=d379dc3f6d96bca53c32e53feb3e6b7a0a7372b4)", - "bee-network 0.1.0-alpha (git+https://github.com/iotaledger/bee.git?rev=d379dc3f6d96bca53c32e53feb3e6b7a0a7372b4)", - "bee-pow 0.1.0-alpha (git+https://github.com/iotaledger/bee.git?rev=d379dc3f6d96bca53c32e53feb3e6b7a0a7372b4)", - "bee-protocol 0.1.0-alpha (git+https://github.com/iotaledger/bee.git?rev=d379dc3f6d96bca53c32e53feb3e6b7a0a7372b4)", + "bee-ledger", + "bee-message", + "bee-pow", + "bee-protocol", "bee-runtime", - "bee-storage", - "bee-tangle 0.1.0-alpha (git+https://github.com/iotaledger/bee.git?rev=d379dc3f6d96bca53c32e53feb3e6b7a0a7372b4)", - "digest 0.9.0", - "futures", "hex", - "iota-crypto 0.3.0 (git+https://github.com/iotaledger/crypto.rs?rev=c3bf565eba62d0b81144174c2ff917bfde282e49)", - "log", - "num_cpus", "serde 1.0.124", "serde_json", - "tokio", - "warp", ] [[package]] name = "bee-runtime" version = "0.1.1-alpha" -source = "git+https://github.com/iotaledger/bee.git?branch=dev#1028da0cd374e74bf8091648d5fe5e9d445fe3fe" +source = "git+https://github.com/iotaledger/bee.git?branch=dev#22c38d0046cf28258b29d0204b17e9aa573a014c" dependencies = [ "async-trait", "bee-storage", @@ -591,27 +455,7 @@ source = "git+https://github.com/iotaledger/bee.git?rev=26215e3af88af4c54f460df7 dependencies = [ "async-trait", "bee-common 0.3.1-alpha (git+https://github.com/iotaledger/bee.git?branch=dev)", - "bee-message 0.1.0-alpha (git+https://github.com/iotaledger/bee.git?rev=26215e3af88af4c54f460df7cffc39d26fdd6e05)", - "bee-runtime", - "bee-storage", - "chrono", - "flume", - "futures", - "log", - "reqwest", - "serde 1.0.124", - "thiserror", - "tokio", -] - -[[package]] -name = "bee-snapshot" -version = "0.1.0-alpha" -source = "git+https://github.com/iotaledger/bee.git?rev=d379dc3f6d96bca53c32e53feb3e6b7a0a7372b4#d379dc3f6d96bca53c32e53feb3e6b7a0a7372b4" -dependencies = [ - "async-trait", - "bee-common 0.3.1-alpha (git+https://github.com/iotaledger/bee.git?branch=dev)", - "bee-message 0.1.0-alpha (git+https://github.com/iotaledger/bee.git?rev=d379dc3f6d96bca53c32e53feb3e6b7a0a7372b4)", + "bee-message", "bee-runtime", "bee-storage", "chrono", @@ -627,7 +471,7 @@ dependencies = [ [[package]] name = "bee-storage" version = "0.2.0-alpha" -source = "git+https://github.com/iotaledger/bee.git?branch=dev#1028da0cd374e74bf8091648d5fe5e9d445fe3fe" +source = "git+https://github.com/iotaledger/bee.git?branch=dev#22c38d0046cf28258b29d0204b17e9aa573a014c" dependencies = [ "async-trait", "futures", @@ -641,9 +485,9 @@ source = "git+https://github.com/iotaledger/bee.git?rev=26215e3af88af4c54f460df7 dependencies = [ "async-trait", "bee-common 0.3.1-alpha (git+https://github.com/iotaledger/bee.git?branch=dev)", - "bee-message 0.1.0-alpha (git+https://github.com/iotaledger/bee.git?rev=26215e3af88af4c54f460df7cffc39d26fdd6e05)", + "bee-message", "bee-runtime", - "bee-snapshot 0.1.0-alpha (git+https://github.com/iotaledger/bee.git?rev=26215e3af88af4c54f460df7cffc39d26fdd6e05)", + "bee-snapshot", "bee-storage", "bitflags", "dashmap 4.0.2", @@ -658,30 +502,6 @@ dependencies = [ "tokio", ] -[[package]] -name = "bee-tangle" -version = "0.1.0-alpha" -source = "git+https://github.com/iotaledger/bee.git?rev=d379dc3f6d96bca53c32e53feb3e6b7a0a7372b4#d379dc3f6d96bca53c32e53feb3e6b7a0a7372b4" -dependencies = [ - "async-trait", - "bee-common 0.3.1-alpha (git+https://github.com/iotaledger/bee.git?branch=dev)", - "bee-message 0.1.0-alpha (git+https://github.com/iotaledger/bee.git?rev=d379dc3f6d96bca53c32e53feb3e6b7a0a7372b4)", - "bee-runtime", - "bee-snapshot 0.1.0-alpha (git+https://github.com/iotaledger/bee.git?rev=d379dc3f6d96bca53c32e53feb3e6b7a0a7372b4)", - "bee-storage", - "bitflags", - "dashmap 4.0.2", - "futures", - "hashbrown 0.9.1", - "log", - "lru", - "rand 0.8.3", - "ref-cast", - "serde 1.0.124", - "thiserror", - "tokio", -] - [[package]] name = "bee-ternary" version = "0.4.0-alpha" @@ -694,7 +514,7 @@ dependencies = [ [[package]] name = "bee-ternary" version = "0.4.1-alpha" -source = "git+https://github.com/iotaledger/bee.git?branch=dev#1028da0cd374e74bf8091648d5fe5e9d445fe3fe" +source = "git+https://github.com/iotaledger/bee.git?branch=dev#22c38d0046cf28258b29d0204b17e9aa573a014c" dependencies = [ "autocfg", "num-traits 0.2.14", @@ -772,16 +592,6 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "771fe0050b883fcc3ea2359b1a96bcfbc090b7116eae7c3c512c7a083fdf23d3" -[[package]] -name = "buf_redux" -version = "0.8.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b953a6887648bb07a535631f2bc00fbdb2a2216f135552cb3f534ed136b9c07f" -dependencies = [ - "memchr", - "safemem", -] - [[package]] name = "bumpalo" version = "3.6.1" @@ -1506,31 +1316,6 @@ dependencies = [ "hashbrown 0.9.1", ] -[[package]] -name = "headers" -version = "0.3.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0b7591fb62902706ae8e7aaff416b1b0fa2c0fd0878b46dc13baa3712d8a855" -dependencies = [ - "base64", - "bitflags", - "bytes", - "headers-core", - "http", - "mime", - "sha-1", - "time", -] - -[[package]] -name = "headers-core" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7f66481bfee273957b1f20485a4ff3362987f85b2c236580d81b4eb7a326429" -dependencies = [ - "http", -] - [[package]] name = "heck" version = "0.3.2" @@ -1739,15 +1524,6 @@ dependencies = [ "hashbrown 0.9.1", ] -[[package]] -name = "input_buffer" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f97967975f448f1a7ddb12b0bc41069d09ed6a1c161a92687e057325db35d413" -dependencies = [ - "bytes", -] - [[package]] name = "instant" version = "0.1.9" @@ -1760,18 +1536,19 @@ dependencies = [ [[package]] name = "iota-client" version = "0.5.0-alpha.3" -source = "git+https://github.com/iotaledger/iota.rs?rev=1554893c01d37ef067a4d7559e33a0da48401cac#1554893c01d37ef067a4d7559e33a0da48401cac" +source = "git+https://github.com/iotaledger/iota.rs?rev=f837a9df7c0f3cecbff87eb6ac3d458d1e50dee0#f837a9df7c0f3cecbff87eb6ac3d458d1e50dee0" dependencies = [ "async-trait", "bee-common 0.3.1-alpha (git+https://github.com/iotaledger/bee.git?branch=dev)", "bee-crypto 0.2.0-alpha (git+https://github.com/iotaledger/bee.git?rev=c42171ff33c80cc2efb183e244dc79b7f58d9ac4)", - "bee-message 0.1.0-alpha (git+https://github.com/iotaledger/bee.git?rev=d379dc3f6d96bca53c32e53feb3e6b7a0a7372b4)", - "bee-pow 0.1.0-alpha (git+https://github.com/iotaledger/bee.git?rev=d379dc3f6d96bca53c32e53feb3e6b7a0a7372b4)", - "bee-rest-api 0.1.0-alpha (git+https://github.com/iotaledger/bee.git?rev=d379dc3f6d96bca53c32e53feb3e6b7a0a7372b4)", + "bee-message", + "bee-pow", + "bee-rest-api", "chrono", "futures", "hex", "iota-crypto 0.3.0 (git+https://github.com/iotaledger/crypto.rs?rev=b849861b86c3f7357b7477de4253b7352b363627)", + "log", "num_cpus", "once_cell", "regex", @@ -1787,14 +1564,14 @@ dependencies = [ [[package]] name = "iota-client" version = "0.5.0-alpha.3" -source = "git+https://github.com/iotaledger/iota.rs?branch=dev#f837a9df7c0f3cecbff87eb6ac3d458d1e50dee0" +source = "git+https://github.com/iotaledger/iota.rs?branch=dev#31e4a23afbac89e856ee24420baee71f657ecdba" dependencies = [ "async-trait", "bee-common 0.3.1-alpha (git+https://github.com/iotaledger/bee.git?branch=dev)", "bee-crypto 0.2.0-alpha (git+https://github.com/iotaledger/bee.git?rev=c42171ff33c80cc2efb183e244dc79b7f58d9ac4)", - "bee-message 0.1.0-alpha (git+https://github.com/iotaledger/bee.git?rev=26215e3af88af4c54f460df7cffc39d26fdd6e05)", - "bee-pow 0.1.0-alpha (git+https://github.com/iotaledger/bee.git?rev=26215e3af88af4c54f460df7cffc39d26fdd6e05)", - "bee-rest-api 0.1.0-alpha (git+https://github.com/iotaledger/bee.git?rev=26215e3af88af4c54f460df7cffc39d26fdd6e05)", + "bee-message", + "bee-pow", + "bee-rest-api", "chrono", "hex", "iota-crypto 0.3.0 (git+https://github.com/iotaledger/crypto.rs?rev=b849861b86c3f7357b7477de4253b7352b363627)", @@ -1811,22 +1588,22 @@ dependencies = [ [[package]] name = "iota-core" version = "0.2.0-alpha.3" -source = "git+https://github.com/iotaledger/iota.rs?rev=1554893c01d37ef067a4d7559e33a0da48401cac#1554893c01d37ef067a4d7559e33a0da48401cac" +source = "git+https://github.com/iotaledger/iota.rs?rev=f837a9df7c0f3cecbff87eb6ac3d458d1e50dee0#f837a9df7c0f3cecbff87eb6ac3d458d1e50dee0" dependencies = [ "bee-common 0.3.1-alpha (git+https://github.com/iotaledger/bee.git?rev=c42171ff33c80cc2efb183e244dc79b7f58d9ac4)", - "bee-message 0.1.0-alpha (git+https://github.com/iotaledger/bee.git?rev=d379dc3f6d96bca53c32e53feb3e6b7a0a7372b4)", - "bee-pow 0.1.0-alpha (git+https://github.com/iotaledger/bee.git?rev=d379dc3f6d96bca53c32e53feb3e6b7a0a7372b4)", - "iota-client 0.5.0-alpha.3 (git+https://github.com/iotaledger/iota.rs?rev=1554893c01d37ef067a4d7559e33a0da48401cac)", + "bee-message", + "bee-pow", + "iota-client 0.5.0-alpha.3 (git+https://github.com/iotaledger/iota.rs?rev=f837a9df7c0f3cecbff87eb6ac3d458d1e50dee0)", ] [[package]] name = "iota-core" version = "0.2.0-alpha.3" -source = "git+https://github.com/iotaledger/iota.rs?branch=dev#f837a9df7c0f3cecbff87eb6ac3d458d1e50dee0" +source = "git+https://github.com/iotaledger/iota.rs?branch=dev#31e4a23afbac89e856ee24420baee71f657ecdba" dependencies = [ "bee-common 0.3.1-alpha (git+https://github.com/iotaledger/bee.git?rev=c42171ff33c80cc2efb183e244dc79b7f58d9ac4)", - "bee-message 0.1.0-alpha (git+https://github.com/iotaledger/bee.git?rev=26215e3af88af4c54f460df7cffc39d26fdd6e05)", - "bee-pow 0.1.0-alpha (git+https://github.com/iotaledger/bee.git?rev=26215e3af88af4c54f460df7cffc39d26fdd6e05)", + "bee-message", + "bee-pow", "iota-client 0.5.0-alpha.3 (git+https://github.com/iotaledger/iota.rs?branch=dev)", ] @@ -1885,7 +1662,7 @@ dependencies = [ [[package]] name = "iota-wallet" version = "0.1.0" -source = "git+https://github.com/iotaledger/wallet.rs?branch=develop#6fed1e6e14087b3d72956e143bbd8f21fe927ba5" +source = "git+https://github.com/iotaledger/wallet.rs?branch=develop#c62b49201493acfda3e36d263b1190bf13beaca1" dependencies = [ "async-trait", "backtrace", @@ -1894,7 +1671,7 @@ dependencies = [ "futures", "getset", "hex", - "iota-core 0.2.0-alpha.3 (git+https://github.com/iotaledger/iota.rs?rev=1554893c01d37ef067a4d7559e33a0da48401cac)", + "iota-core 0.2.0-alpha.3 (git+https://github.com/iotaledger/iota.rs?rev=f837a9df7c0f3cecbff87eb6ac3d458d1e50dee0)", "iota-crypto 0.3.0 (git+https://github.com/iotaledger/crypto.rs?rev=b849861b86c3f7357b7477de4253b7352b363627)", "iota-stronghold", "log", @@ -2253,16 +2030,6 @@ version = "0.3.16" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2a60c7ce501c71e03a9c9c0d35b861413ae925bd979cc7a4e30d060069aaac8d" -[[package]] -name = "mime_guess" -version = "2.0.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2684d4c2e97d99848d30b324b00c8fcc7e5c897b7cbb5819b09e7c90e8baf212" -dependencies = [ - "mime", - "unicase", -] - [[package]] name = "miniz_oxide" version = "0.4.4" @@ -2338,24 +2105,6 @@ version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e5ce46fe64a9d73be07dcbe690a38ce1b293be448fd8ce1e6c1b8062c9f72c6a" -[[package]] -name = "multipart" -version = "0.17.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d050aeedc89243f5347c3e237e3e13dc76fbe4ae3742a57b94dc14f69acf76d4" -dependencies = [ - "buf_redux", - "httparse", - "log", - "mime", - "mime_guess", - "quick-error", - "rand 0.7.3", - "safemem", - "tempfile", - "twoway", -] - [[package]] name = "multistream-select" version = "0.10.2" @@ -2589,9 +2338,9 @@ dependencies = [ [[package]] name = "parity-multiaddr" -version = "0.11.1" +version = "0.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d2c6805f98667a3828afb2ec2c396a8d610497e8d546f5447188aae47c5a79ec" +checksum = "58341485071825827b7f03cf7efd1cb21e6a709bea778fb50227fd45d2f361b4" dependencies = [ "arrayref", "bs58", @@ -2644,9 +2393,9 @@ checksum = "acbf547ad0c65e31259204bd90935776d1c693cec2f4ff7abb7a1bbbd40dfe58" [[package]] name = "pbkdf2" -version = "0.7.3" +version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "309c95c5f738c85920eb7062a2de29f3840d4f96974453fc9ac1ba078da9c627" +checksum = "297e1dad0e9de7af53235b833761351bf6bda57d6acb4f263b61a2ddf674f1dc" dependencies = [ "crypto-mac 0.10.0", ] @@ -2894,12 +2643,6 @@ dependencies = [ "percent-encoding", ] -[[package]] -name = "quick-error" -version = "1.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1d01941d82fa2ab50be1e79e6714289dd7cde78eba4c074bc5a4374f650dfe0" - [[package]] name = "quote" version = "0.6.13" @@ -3243,12 +2986,6 @@ version = "1.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "71d301d4193d031abdd79ff7e3dd721168a9572ef3fe51a1517aba235bd8f86e" -[[package]] -name = "safemem" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef703b7cb59335eae2eb93ceb664c0eb7ea6bf567079d843e09420219668e072" - [[package]] name = "schannel" version = "0.1.19" @@ -3259,12 +2996,6 @@ dependencies = [ "winapi", ] -[[package]] -name = "scoped-tls" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea6a9290e3c9cf0f18145ef7ffa62d68ee0bf5fcd651017e586dc7fd5da448c2" - [[package]] name = "scopeguard" version = "1.1.0" @@ -3401,19 +3132,6 @@ dependencies = [ "serde 1.0.124", ] -[[package]] -name = "sha-1" -version = "0.9.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dfebf75d25bd900fd1e7d11501efab59bc846dbc76196839663e6637bba9f25f" -dependencies = [ - "block-buffer 0.9.0", - "cfg-if 1.0.0", - "cpuid-bool 0.1.2", - "digest 0.9.0", - "opaque-debug 0.3.0", -] - [[package]] name = "sha2" version = "0.8.2" @@ -3790,19 +3508,6 @@ dependencies = [ "tokio", ] -[[package]] -name = "tokio-tungstenite" -version = "0.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e1a5f475f1b9d077ea1017ecbc60890fda8e54942d680ca0b1d2b47cfa2d861b" -dependencies = [ - "futures-util", - "log", - "pin-project 1.0.5", - "tokio", - "tungstenite", -] - [[package]] name = "tokio-util" version = "0.6.4" @@ -3839,7 +3544,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "01ebdc2bb4498ab1ab5f5b73c5803825e60199229ccba0698170e3be0e7f959f" dependencies = [ "cfg-if 1.0.0", - "log", "pin-project-lite", "tracing-core", ] @@ -3853,50 +3557,12 @@ dependencies = [ "lazy_static", ] -[[package]] -name = "tracing-futures" -version = "0.2.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97d095ae15e245a057c8e8451bab9b3ee1e1f68e9ba2b4fbc18d0ac5237835f2" -dependencies = [ - "pin-project 1.0.5", - "tracing", -] - [[package]] name = "try-lock" version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "59547bce71d9c38b83d9c0e92b6066c4253371f15005def0c30d9657f50c7642" -[[package]] -name = "tungstenite" -version = "0.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ada8297e8d70872fa9a551d93250a9f407beb9f37ef86494eb20012a2ff7c24" -dependencies = [ - "base64", - "byteorder", - "bytes", - "http", - "httparse", - "input_buffer", - "log", - "rand 0.8.3", - "sha-1", - "url", - "utf-8", -] - -[[package]] -name = "twoway" -version = "0.1.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59b11b2b5241ba34be09c3cc85a36e56e48f9888862e19cedf23336d35316ed1" -dependencies = [ - "memchr", -] - [[package]] name = "twox-hash" version = "1.6.0" @@ -3914,15 +3580,6 @@ version = "1.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "879f6906492a7cd215bfa4cf595b600146ccfac0c79bcbd1f3000162af5e8b06" -[[package]] -name = "unicase" -version = "2.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50f37be617794602aabbeee0be4f259dc1778fabe05e2d67ee8f79326d5cb4f6" -dependencies = [ - "version_check", -] - [[package]] name = "unicode-bidi" version = "0.3.4" @@ -4019,12 +3676,6 @@ dependencies = [ "serde 1.0.124", ] -[[package]] -name = "utf-8" -version = "0.7.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05e42f7c18b8f902290b009cde6d651262f956c98bc51bca4cd1d511c9cd85c7" - [[package]] name = "uuid" version = "0.8.2" @@ -4100,36 +3751,6 @@ dependencies = [ "try-lock", ] -[[package]] -name = "warp" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3dafd0aac2818a94a34df0df1100a7356c493d8ede4393875fd0b5c51bb6bc80" -dependencies = [ - "bytes", - "futures", - "headers", - "http", - "hyper", - "log", - "mime", - "mime_guess", - "multipart", - "percent-encoding", - "pin-project 1.0.5", - "scoped-tls", - "serde 1.0.124", - "serde_json", - "serde_urlencoded", - "tokio", - "tokio-stream", - "tokio-tungstenite", - "tokio-util", - "tower-service", - "tracing", - "tracing-futures", -] - [[package]] name = "wasi" version = "0.9.0+wasi-snapshot-preview1" From c01f512237e03547490e5e67ca73b8dc60f39673 Mon Sep 17 00:00:00 2001 From: Lucas Nogueira Date: Thu, 18 Mar 2021 22:01:45 -0300 Subject: [PATCH 07/14] fix: do not update incoming/outgoing if we have the message already --- packages/shared/lib/wallet.ts | 64 +++++++++++-------- .../routes/dashboard/wallet/Wallet.svelte | 5 +- 2 files changed, 40 insertions(+), 29 deletions(-) diff --git a/packages/shared/lib/wallet.ts b/packages/shared/lib/wallet.ts index 4849fbe89c2..a4e010ff608 100644 --- a/packages/shared/lib/wallet.ts +++ b/packages/shared/lib/wallet.ts @@ -12,7 +12,7 @@ import type { ErrorEventPayload, TransferProgressEventType } from 'shared/lib/ty import type { Message } from 'shared/lib/typings/message' import { formatUnit } from 'shared/lib/units' import type { ApiClient } from 'shared/lib/walletApi' -import { get, writable, Writable } from 'svelte/store' +import { get, writable, Writable, derived } from 'svelte/store' const ACCOUNT_COLORS = ['turquoise', 'green', 'orange', 'yellow', 'purple', 'pink'] @@ -92,6 +92,10 @@ export const wallet = writable({ accountsLoaded: writable(false), }) +export const transactions = derived(get(wallet).accounts, ($accounts) => { + return getLatestMessages($accounts) +}) + export const resetWallet = () => { const { balanceOverview, accounts, accountsLoaded } = get(wallet) balanceOverview.set({ @@ -205,18 +209,23 @@ export const initialiseListeners = () => { const essence = message.payload.data.essence - if (!essence.data.internal) { - const { balanceOverview } = get(wallet); - const overview = get(balanceOverview); - - const incoming = essence.data.incoming ? overview.incomingRaw + essence.data.value : overview.incomingRaw; - const outgoing = essence.data.incoming ? overview.outgoingRaw : overview.outgoingRaw + essence.data.value; - - updateBalanceOverview( - overview.balanceRaw, - incoming, - outgoing - ) + const walletTransactions = get(transactions); + // if we already have this message on one of the accounts, + // we skip updating incoming/outgoing values. + if (!walletTransactions.some((transaction) => transaction.id === message.id)) { + if (!essence.data.internal) { + const { balanceOverview } = get(wallet); + const overview = get(balanceOverview); + + const incoming = essence.data.incoming ? overview.incomingRaw + essence.data.value : overview.incomingRaw; + const outgoing = essence.data.incoming ? overview.outgoingRaw : overview.outgoingRaw + essence.data.value; + + updateBalanceOverview( + overview.balanceRaw, + incoming, + outgoing + ); + } } const notificationMessage = localize('notifications.valueTx') @@ -245,18 +254,23 @@ export const initialiseListeners = () => { const essence = message.payload.data.essence - if (!essence.data.internal) { - const { balanceOverview } = get(wallet); - const overview = get(balanceOverview); - - const incoming = essence.data.incoming ? overview.incomingRaw + essence.data.value : overview.incomingRaw; - const outgoing = essence.data.incoming ? overview.outgoingRaw : overview.outgoingRaw + essence.data.value; - - updateBalanceOverview( - overview.balanceRaw, - incoming, - outgoing - ) + if (response.payload.confirmed && !essence.data.internal) { + const walletTransactions = get(transactions); + // if we already have this message marked as confirmed, + // we skip updating incoming/outgoing values. + if (!walletTransactions.some((transaction) => transaction.id === message.id && transaction.confirmed)) { + const { balanceOverview } = get(wallet); + const overview = get(balanceOverview); + + const incoming = essence.data.incoming ? overview.incomingRaw + essence.data.value : overview.incomingRaw; + const outgoing = essence.data.incoming ? overview.outgoingRaw : overview.outgoingRaw + essence.data.value; + + updateBalanceOverview( + overview.balanceRaw, + incoming, + outgoing + ); + } } const accountMessage = account.messages.find((_message) => _message.id === message.id) diff --git a/packages/shared/routes/dashboard/wallet/Wallet.svelte b/packages/shared/routes/dashboard/wallet/Wallet.svelte index bf61fe00846..efc91dfee22 100644 --- a/packages/shared/routes/dashboard/wallet/Wallet.svelte +++ b/packages/shared/routes/dashboard/wallet/Wallet.svelte @@ -17,7 +17,7 @@ BalanceOverview, getAccountMeta, getAccountsBalanceHistory, - getLatestMessages, + transactions, getWalletBalanceHistory, initialiseListeners, isTransferring, @@ -37,9 +37,6 @@ const { accounts, balanceOverview, accountsLoaded } = $wallet - const transactions = derived(accounts, ($accounts) => { - return getLatestMessages($accounts) - }) const accountsBalanceHistory = derived([accounts, priceData], ([$accounts, $priceData]) => getAccountsBalanceHistory($accounts, $priceData) ) From 2e2f576e8cda7a728a054f0aa6787352e1d4dcaf Mon Sep 17 00:00:00 2001 From: Lucas Nogueira Date: Fri, 19 Mar 2021 13:18:00 -0300 Subject: [PATCH 08/14] feat: add `removeEventListeners` API --- .../backend/bindings/node/native/src/lib.rs | 9 ++++++++- packages/backend/src/lib.rs | 20 +++++++++++++++---- 2 files changed, 24 insertions(+), 5 deletions(-) diff --git a/packages/backend/bindings/node/native/src/lib.rs b/packages/backend/bindings/node/native/src/lib.rs index 7ed012b01cf..0d2ad48fd5c 100644 --- a/packages/backend/bindings/node/native/src/lib.rs +++ b/packages/backend/bindings/node/native/src/lib.rs @@ -7,7 +7,7 @@ use std::sync::{ }; use tokio::runtime::Runtime; use wallet_actor_system::{ - destroy as destroy_actor, init as init_actor, init_logger as init_backend_logger, + destroy as destroy_actor, remove_event_listeners as remove_actor_event_listeners, init as init_actor, init_logger as init_backend_logger, listen as add_event_listener, send_message as send_actor_message, EventType, LoggerConfigBuilder, }; @@ -105,6 +105,13 @@ declare_types! { Ok(cx.undefined().upcast()) } + method removeEventListeners(mut cx) { + let this = cx.this(); + let actor_id = cx.borrow(&this, |emitter| emitter.actor_id.clone()); + block_on(remove_actor_event_listeners(actor_id)); + Ok(cx.undefined().upcast()) + } + // This method should be called by JS to receive data. It accepts a // `function (err, data)` style asynchronous callback. It may be called // in a loop, but care should be taken to only call it once at a time. diff --git a/packages/backend/src/lib.rs b/packages/backend/src/lib.rs index 55c4852a004..07a724c3efa 100644 --- a/packages/backend/src/lib.rs +++ b/packages/backend/src/lib.rs @@ -124,12 +124,16 @@ pub async fn init, F: Fn(String) + Send + Sync + 'static>( .await; } -pub async fn destroy>(actor_id: A) { +pub async fn remove_event_listeners>(actor_id: A) { let mut actors = wallet_actors().lock().await; - let actor_id = actor_id.into(); + if let Some(actor_data) = actors.get_mut(&actor_id.into()) { + remove_event_listeners_internal(&actor_data.listeners).await; + actor_data.listeners = Vec::new(); + } +} - if let Some(actor_data) = actors.remove(&actor_id) { - for (event_id, event_type) in &actor_data.listeners { +async fn remove_event_listeners_internal(listeners: &[(EventId, EventType)]) { + for (event_id, event_type) in listeners.iter() { match event_type { &EventType::ErrorThrown => remove_error_listener(event_id), &EventType::BalanceChange => remove_balance_change_listener(event_id).await, @@ -145,6 +149,14 @@ pub async fn destroy>(actor_id: A) { &EventType::TransferProgress => remove_transfer_progress_listener(event_id).await, }; } +} + +pub async fn destroy>(actor_id: A) { + let mut actors = wallet_actors().lock().await; + let actor_id = actor_id.into(); + + if let Some(actor_data) = actors.remove(&actor_id) { + remove_event_listeners_internal(&actor_data.listeners).await; actor_data.actor.tell(actors::KillMessage, None); iota_wallet::with_actor_system(|sys| { From bc51ec4dc91397d783125c910384d0ec28b0b0a8 Mon Sep 17 00:00:00 2001 From: Lucas Nogueira Date: Fri, 19 Mar 2021 15:15:42 -0300 Subject: [PATCH 09/14] fix: expose removeEventListeners function --- packages/backend/bindings/node/index.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/packages/backend/bindings/node/index.ts b/packages/backend/bindings/node/index.ts index 28cb05d1d92..5340578723e 100644 --- a/packages/backend/bindings/node/index.ts +++ b/packages/backend/bindings/node/index.ts @@ -76,6 +76,9 @@ export function init(id: string, storagePath?: string) { destroy() { destroyed = true runtime.destroy() + }, + removeEventListeners() { + runtime.removeEventListeners() } } } From 87180eef860d119fb5d87df5462ffd8ac55c8f22 Mon Sep 17 00:00:00 2001 From: Umair Sarfraz Date: Fri, 19 Mar 2021 20:18:26 +0100 Subject: [PATCH 10/14] feat: remove event listeners before initialising new ones --- .../backend/bindings/node/native/Cargo.lock | 182 +++++++++++++----- packages/shared/lib/typings/bridge.ts | 1 + packages/shared/lib/wallet.ts | 13 ++ .../routes/dashboard/wallet/Wallet.svelte | 5 +- 4 files changed, 149 insertions(+), 52 deletions(-) diff --git a/packages/backend/bindings/node/native/Cargo.lock b/packages/backend/bindings/node/native/Cargo.lock index 09aa4bb0005..9f3727eb0b6 100644 --- a/packages/backend/bindings/node/native/Cargo.lock +++ b/packages/backend/bindings/node/native/Cargo.lock @@ -279,7 +279,7 @@ dependencies = [ [[package]] name = "bee-common" version = "0.3.1-alpha" -source = "git+https://github.com/iotaledger/bee.git?branch=dev#22c38d0046cf28258b29d0204b17e9aa573a014c" +source = "git+https://github.com/iotaledger/bee.git?branch=dev#a65bfad5dfdc8aa46d34b6b58899007a43d72340" dependencies = [ "autocfg", "chrono", @@ -304,7 +304,7 @@ dependencies = [ [[package]] name = "bee-crypto" version = "0.2.0-alpha" -source = "git+https://github.com/iotaledger/bee.git?branch=dev#22c38d0046cf28258b29d0204b17e9aa573a014c" +source = "git+https://github.com/iotaledger/bee.git?branch=dev#a65bfad5dfdc8aa46d34b6b58899007a43d72340" dependencies = [ "bee-ternary 0.4.1-alpha", "byteorder", @@ -313,6 +313,16 @@ dependencies = [ "tiny-keccak", ] +[[package]] +name = "bee-ledger" +version = "0.1.0-alpha" +source = "git+https://github.com/iotaledger/bee.git?rev=217b5944b5e17fe5800955d212cfe8dddd992482#217b5944b5e17fe5800955d212cfe8dddd992482" +dependencies = [ + "bee-common 0.3.1-alpha (git+https://github.com/iotaledger/bee.git?branch=dev)", + "bee-message 0.1.0-alpha (git+https://github.com/iotaledger/bee.git?rev=217b5944b5e17fe5800955d212cfe8dddd992482)", + "thiserror", +] + [[package]] name = "bee-ledger" version = "0.1.0-alpha" @@ -321,7 +331,7 @@ dependencies = [ "async-trait", "bee-common 0.3.1-alpha (git+https://github.com/iotaledger/bee.git?branch=dev)", "bee-crypto 0.2.0-alpha (git+https://github.com/iotaledger/bee.git?branch=dev)", - "bee-message", + "bee-message 0.1.0-alpha (git+https://github.com/iotaledger/bee.git?rev=26215e3af88af4c54f460df7cffc39d26fdd6e05)", "bee-runtime", "bee-snapshot", "bee-storage", @@ -339,6 +349,22 @@ dependencies = [ "tokio-stream", ] +[[package]] +name = "bee-message" +version = "0.1.0-alpha" +source = "git+https://github.com/iotaledger/bee.git?rev=217b5944b5e17fe5800955d212cfe8dddd992482#217b5944b5e17fe5800955d212cfe8dddd992482" +dependencies = [ + "bech32", + "bee-common 0.3.1-alpha (git+https://github.com/iotaledger/bee.git?branch=dev)", + "bee-pow 0.1.0-alpha (git+https://github.com/iotaledger/bee.git?rev=217b5944b5e17fe5800955d212cfe8dddd992482)", + "digest 0.9.0", + "hex", + "iota-crypto 0.3.0 (git+https://github.com/iotaledger/crypto.rs?rev=c3bf565eba62d0b81144174c2ff917bfde282e49)", + "ref-cast", + "serde 1.0.124", + "thiserror", +] + [[package]] name = "bee-message" version = "0.1.0-alpha" @@ -346,7 +372,7 @@ source = "git+https://github.com/iotaledger/bee.git?rev=26215e3af88af4c54f460df7 dependencies = [ "bech32", "bee-common 0.3.1-alpha (git+https://github.com/iotaledger/bee.git?branch=dev)", - "bee-pow", + "bee-pow 0.1.0-alpha (git+https://github.com/iotaledger/bee.git?rev=26215e3af88af4c54f460df7cffc39d26fdd6e05)", "digest 0.9.0", "hex", "iota-crypto 0.3.0 (git+https://github.com/iotaledger/crypto.rs?rev=c3bf565eba62d0b81144174c2ff917bfde282e49)", @@ -355,6 +381,25 @@ dependencies = [ "thiserror", ] +[[package]] +name = "bee-network" +version = "0.1.0-alpha" +source = "git+https://github.com/iotaledger/bee.git?rev=217b5944b5e17fe5800955d212cfe8dddd992482#217b5944b5e17fe5800955d212cfe8dddd992482" +dependencies = [ + "async-trait", + "bee-runtime", + "futures", + "lazy_static", + "libp2p", + "log", + "rand 0.8.3", + "serde 1.0.124", + "thiserror", + "tokio", + "tokio-stream", + "url", +] + [[package]] name = "bee-network" version = "0.1.0-alpha" @@ -374,6 +419,17 @@ dependencies = [ "url", ] +[[package]] +name = "bee-pow" +version = "0.1.0-alpha" +source = "git+https://github.com/iotaledger/bee.git?rev=217b5944b5e17fe5800955d212cfe8dddd992482#217b5944b5e17fe5800955d212cfe8dddd992482" +dependencies = [ + "bee-crypto 0.2.0-alpha (git+https://github.com/iotaledger/bee.git?branch=dev)", + "bee-ternary 0.4.1-alpha", + "iota-crypto 0.3.0 (git+https://github.com/iotaledger/crypto.rs?rev=c3bf565eba62d0b81144174c2ff917bfde282e49)", + "thiserror", +] + [[package]] name = "bee-pow" version = "0.1.0-alpha" @@ -385,6 +441,15 @@ dependencies = [ "thiserror", ] +[[package]] +name = "bee-protocol" +version = "0.1.0-alpha" +source = "git+https://github.com/iotaledger/bee.git?rev=217b5944b5e17fe5800955d212cfe8dddd992482#217b5944b5e17fe5800955d212cfe8dddd992482" +dependencies = [ + "bee-message 0.1.0-alpha (git+https://github.com/iotaledger/bee.git?rev=217b5944b5e17fe5800955d212cfe8dddd992482)", + "bee-network 0.1.0-alpha (git+https://github.com/iotaledger/bee.git?rev=217b5944b5e17fe5800955d212cfe8dddd992482)", +] + [[package]] name = "bee-protocol" version = "0.1.0-alpha" @@ -395,9 +460,9 @@ dependencies = [ "async-trait", "bee-common 0.3.1-alpha (git+https://github.com/iotaledger/bee.git?branch=dev)", "bee-crypto 0.2.0-alpha (git+https://github.com/iotaledger/bee.git?branch=dev)", - "bee-ledger", - "bee-message", - "bee-network", + "bee-ledger 0.1.0-alpha (git+https://github.com/iotaledger/bee.git?rev=26215e3af88af4c54f460df7cffc39d26fdd6e05)", + "bee-message 0.1.0-alpha (git+https://github.com/iotaledger/bee.git?rev=26215e3af88af4c54f460df7cffc39d26fdd6e05)", + "bee-network 0.1.0-alpha (git+https://github.com/iotaledger/bee.git?rev=26215e3af88af4c54f460df7cffc39d26fdd6e05)", "bee-runtime", "bee-snapshot", "bee-storage", @@ -421,15 +486,29 @@ dependencies = [ "twox-hash", ] +[[package]] +name = "bee-rest-api" +version = "0.1.0-alpha" +source = "git+https://github.com/iotaledger/bee.git?rev=217b5944b5e17fe5800955d212cfe8dddd992482#217b5944b5e17fe5800955d212cfe8dddd992482" +dependencies = [ + "bee-ledger 0.1.0-alpha (git+https://github.com/iotaledger/bee.git?rev=217b5944b5e17fe5800955d212cfe8dddd992482)", + "bee-message 0.1.0-alpha (git+https://github.com/iotaledger/bee.git?rev=217b5944b5e17fe5800955d212cfe8dddd992482)", + "bee-pow 0.1.0-alpha (git+https://github.com/iotaledger/bee.git?rev=217b5944b5e17fe5800955d212cfe8dddd992482)", + "bee-protocol 0.1.0-alpha (git+https://github.com/iotaledger/bee.git?rev=217b5944b5e17fe5800955d212cfe8dddd992482)", + "hex", + "serde 1.0.124", + "serde_json", +] + [[package]] name = "bee-rest-api" version = "0.1.0-alpha" source = "git+https://github.com/iotaledger/bee.git?rev=26215e3af88af4c54f460df7cffc39d26fdd6e05#26215e3af88af4c54f460df7cffc39d26fdd6e05" dependencies = [ - "bee-ledger", - "bee-message", - "bee-pow", - "bee-protocol", + "bee-ledger 0.1.0-alpha (git+https://github.com/iotaledger/bee.git?rev=26215e3af88af4c54f460df7cffc39d26fdd6e05)", + "bee-message 0.1.0-alpha (git+https://github.com/iotaledger/bee.git?rev=26215e3af88af4c54f460df7cffc39d26fdd6e05)", + "bee-pow 0.1.0-alpha (git+https://github.com/iotaledger/bee.git?rev=26215e3af88af4c54f460df7cffc39d26fdd6e05)", + "bee-protocol 0.1.0-alpha (git+https://github.com/iotaledger/bee.git?rev=26215e3af88af4c54f460df7cffc39d26fdd6e05)", "bee-runtime", "hex", "serde 1.0.124", @@ -439,7 +518,7 @@ dependencies = [ [[package]] name = "bee-runtime" version = "0.1.1-alpha" -source = "git+https://github.com/iotaledger/bee.git?branch=dev#22c38d0046cf28258b29d0204b17e9aa573a014c" +source = "git+https://github.com/iotaledger/bee.git?branch=dev#a65bfad5dfdc8aa46d34b6b58899007a43d72340" dependencies = [ "async-trait", "bee-storage", @@ -455,7 +534,7 @@ source = "git+https://github.com/iotaledger/bee.git?rev=26215e3af88af4c54f460df7 dependencies = [ "async-trait", "bee-common 0.3.1-alpha (git+https://github.com/iotaledger/bee.git?branch=dev)", - "bee-message", + "bee-message 0.1.0-alpha (git+https://github.com/iotaledger/bee.git?rev=26215e3af88af4c54f460df7cffc39d26fdd6e05)", "bee-runtime", "bee-storage", "chrono", @@ -471,7 +550,7 @@ dependencies = [ [[package]] name = "bee-storage" version = "0.2.0-alpha" -source = "git+https://github.com/iotaledger/bee.git?branch=dev#22c38d0046cf28258b29d0204b17e9aa573a014c" +source = "git+https://github.com/iotaledger/bee.git?branch=dev#a65bfad5dfdc8aa46d34b6b58899007a43d72340" dependencies = [ "async-trait", "futures", @@ -485,7 +564,7 @@ source = "git+https://github.com/iotaledger/bee.git?rev=26215e3af88af4c54f460df7 dependencies = [ "async-trait", "bee-common 0.3.1-alpha (git+https://github.com/iotaledger/bee.git?branch=dev)", - "bee-message", + "bee-message 0.1.0-alpha (git+https://github.com/iotaledger/bee.git?rev=26215e3af88af4c54f460df7cffc39d26fdd6e05)", "bee-runtime", "bee-snapshot", "bee-storage", @@ -514,7 +593,7 @@ dependencies = [ [[package]] name = "bee-ternary" version = "0.4.1-alpha" -source = "git+https://github.com/iotaledger/bee.git?branch=dev#22c38d0046cf28258b29d0204b17e9aa573a014c" +source = "git+https://github.com/iotaledger/bee.git?branch=dev#a65bfad5dfdc8aa46d34b6b58899007a43d72340" dependencies = [ "autocfg", "num-traits 0.2.14", @@ -1394,12 +1473,13 @@ dependencies = [ [[package]] name = "http-body" -version = "0.4.0" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2861bd27ee074e5ee891e8b539837a9430012e249d7f0ca2d795650f579c1994" +checksum = "5dfb77c123b4e2f72a2069aeae0b4b4949cc7e966df277813fc16347e7549737" dependencies = [ "bytes", "http", + "pin-project-lite", ] [[package]] @@ -1541,9 +1621,9 @@ dependencies = [ "async-trait", "bee-common 0.3.1-alpha (git+https://github.com/iotaledger/bee.git?branch=dev)", "bee-crypto 0.2.0-alpha (git+https://github.com/iotaledger/bee.git?rev=c42171ff33c80cc2efb183e244dc79b7f58d9ac4)", - "bee-message", - "bee-pow", - "bee-rest-api", + "bee-message 0.1.0-alpha (git+https://github.com/iotaledger/bee.git?rev=26215e3af88af4c54f460df7cffc39d26fdd6e05)", + "bee-pow 0.1.0-alpha (git+https://github.com/iotaledger/bee.git?rev=26215e3af88af4c54f460df7cffc39d26fdd6e05)", + "bee-rest-api 0.1.0-alpha (git+https://github.com/iotaledger/bee.git?rev=26215e3af88af4c54f460df7cffc39d26fdd6e05)", "chrono", "futures", "hex", @@ -1564,14 +1644,14 @@ dependencies = [ [[package]] name = "iota-client" version = "0.5.0-alpha.3" -source = "git+https://github.com/iotaledger/iota.rs?branch=dev#72a62bc4934d736677eefbfb66c678bbebe1c814" +source = "git+https://github.com/iotaledger/iota.rs?branch=dev#23b8faf6ba7cce4a58fb47bb302bd56c4430758c" dependencies = [ "async-trait", "bee-common 0.3.1-alpha (git+https://github.com/iotaledger/bee.git?branch=dev)", "bee-crypto 0.2.0-alpha (git+https://github.com/iotaledger/bee.git?rev=c42171ff33c80cc2efb183e244dc79b7f58d9ac4)", - "bee-message", - "bee-pow", - "bee-rest-api", + "bee-message 0.1.0-alpha (git+https://github.com/iotaledger/bee.git?rev=217b5944b5e17fe5800955d212cfe8dddd992482)", + "bee-pow 0.1.0-alpha (git+https://github.com/iotaledger/bee.git?rev=217b5944b5e17fe5800955d212cfe8dddd992482)", + "bee-rest-api 0.1.0-alpha (git+https://github.com/iotaledger/bee.git?rev=217b5944b5e17fe5800955d212cfe8dddd992482)", "chrono", "hex", "iota-crypto 0.3.0 (git+https://github.com/iotaledger/crypto.rs?rev=b849861b86c3f7357b7477de4253b7352b363627)", @@ -1591,19 +1671,19 @@ version = "0.2.0-alpha.3" source = "git+https://github.com/iotaledger/iota.rs?rev=f837a9df7c0f3cecbff87eb6ac3d458d1e50dee0#f837a9df7c0f3cecbff87eb6ac3d458d1e50dee0" dependencies = [ "bee-common 0.3.1-alpha (git+https://github.com/iotaledger/bee.git?rev=c42171ff33c80cc2efb183e244dc79b7f58d9ac4)", - "bee-message", - "bee-pow", + "bee-message 0.1.0-alpha (git+https://github.com/iotaledger/bee.git?rev=26215e3af88af4c54f460df7cffc39d26fdd6e05)", + "bee-pow 0.1.0-alpha (git+https://github.com/iotaledger/bee.git?rev=26215e3af88af4c54f460df7cffc39d26fdd6e05)", "iota-client 0.5.0-alpha.3 (git+https://github.com/iotaledger/iota.rs?rev=f837a9df7c0f3cecbff87eb6ac3d458d1e50dee0)", ] [[package]] name = "iota-core" version = "0.2.0-alpha.3" -source = "git+https://github.com/iotaledger/iota.rs?branch=dev#72a62bc4934d736677eefbfb66c678bbebe1c814" +source = "git+https://github.com/iotaledger/iota.rs?branch=dev#23b8faf6ba7cce4a58fb47bb302bd56c4430758c" dependencies = [ "bee-common 0.3.1-alpha (git+https://github.com/iotaledger/bee.git?rev=c42171ff33c80cc2efb183e244dc79b7f58d9ac4)", - "bee-message", - "bee-pow", + "bee-message 0.1.0-alpha (git+https://github.com/iotaledger/bee.git?rev=217b5944b5e17fe5800955d212cfe8dddd992482)", + "bee-pow 0.1.0-alpha (git+https://github.com/iotaledger/bee.git?rev=217b5944b5e17fe5800955d212cfe8dddd992482)", "iota-client 0.5.0-alpha.3 (git+https://github.com/iotaledger/iota.rs?branch=dev)", ] @@ -1662,7 +1742,7 @@ dependencies = [ [[package]] name = "iota-wallet" version = "0.1.0" -source = "git+https://github.com/iotaledger/wallet.rs?branch=develop#c62b49201493acfda3e36d263b1190bf13beaca1" +source = "git+https://github.com/iotaledger/wallet.rs?branch=develop#43f055b4e044ce32a10549a9e134d2386833ed1e" dependencies = [ "async-trait", "backtrace", @@ -1713,9 +1793,9 @@ checksum = "dd25036021b0de88a0aff6b850051563c6516d0bf53f8638938edbb9de732736" [[package]] name = "js-sys" -version = "0.3.48" +version = "0.3.49" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc9f84f9b115ce7843d60706df1422a916680bfdfcbdb0447c5614ff9d7e4d78" +checksum = "dc15e39392125075f60c95ba416f5381ff6c3a948ff02ab12464715adf56c821" dependencies = [ "wasm-bindgen", ] @@ -1741,9 +1821,9 @@ dependencies = [ [[package]] name = "libc" -version = "0.2.89" +version = "0.2.90" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "538c092e5586f4cdd7dd8078c4a79220e3e168880218124dcbce860f0ea938c6" +checksum = "ba4aede83fc3617411dc6993bc8c70919750c1c257c6ca6a502aed6e0e2394ae" [[package]] name = "libp2p" @@ -2489,9 +2569,9 @@ dependencies = [ [[package]] name = "pollster" -version = "0.2.1" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a0c427c464eaca5923b642b3b346792b9c98edd91026aa6a753435e42d2a07b" +checksum = "75721b4c756dd61e006f1d3fe1e44bda75ad3a3d8eaa45e9f32943cbe635e663" [[package]] name = "poly1305" @@ -3765,9 +3845,9 @@ checksum = "fd6fbd9a79829dd1ad0cc20627bf1ed606756a7f77edff7b66b7064f9cb327c6" [[package]] name = "wasm-bindgen" -version = "0.2.71" +version = "0.2.72" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ee1280240b7c461d6a0071313e08f34a60b0365f14260362e5a2b17d1d31aa7" +checksum = "8fe8f61dba8e5d645a4d8132dc7a0a66861ed5e1045d2c0ed940fab33bac0fbe" dependencies = [ "cfg-if 1.0.0", "serde 1.0.124", @@ -3777,9 +3857,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-backend" -version = "0.2.71" +version = "0.2.72" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b7d8b6942b8bb3a9b0e73fc79b98095a27de6fa247615e59d096754a3bc2aa8" +checksum = "046ceba58ff062da072c7cb4ba5b22a37f00a302483f7e2a6cdc18fedbdc1fd3" dependencies = [ "bumpalo", "lazy_static", @@ -3792,9 +3872,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-futures" -version = "0.4.21" +version = "0.4.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e67a5806118af01f0d9045915676b22aaebecf4178ae7021bc171dab0b897ab" +checksum = "73157efb9af26fb564bb59a009afd1c7c334a44db171d280690d0c3faaec3468" dependencies = [ "cfg-if 1.0.0", "js-sys", @@ -3804,9 +3884,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.71" +version = "0.2.72" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5ac38da8ef716661f0f36c0d8320b89028efe10c7c0afde65baffb496ce0d3b" +checksum = "0ef9aa01d36cda046f797c57959ff5f3c615c9cc63997a8d545831ec7976819b" dependencies = [ "quote 1.0.9", "wasm-bindgen-macro-support", @@ -3814,9 +3894,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.71" +version = "0.2.72" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc053ec74d454df287b9374ee8abb36ffd5acb95ba87da3ba5b7d3fe20eb401e" +checksum = "96eb45c1b2ee33545a813a92dbb53856418bf7eb54ab34f7f7ff1448a5b3735d" dependencies = [ "proc-macro2 1.0.24", "quote 1.0.9", @@ -3827,9 +3907,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-shared" -version = "0.2.71" +version = "0.2.72" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d6f8ec44822dd71f5f221a5847fb34acd9060535c1211b70a05844c0f6383b1" +checksum = "b7148f4696fb4960a346eaa60bbfb42a1ac4ebba21f750f75fc1375b098d5ffa" [[package]] name = "wasm-timer" @@ -3848,9 +3928,9 @@ dependencies = [ [[package]] name = "web-sys" -version = "0.3.48" +version = "0.3.49" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec600b26223b2948cedfde2a0aa6756dcf1fef616f43d7b3097aaf53a6c4d92b" +checksum = "59fe19d70f5dacc03f6e46777213facae5ac3801575d56ca6cbd4c93dcd12310" dependencies = [ "js-sys", "wasm-bindgen", diff --git a/packages/shared/lib/typings/bridge.ts b/packages/shared/lib/typings/bridge.ts index b8bb3b33186..69041ac09d3 100644 --- a/packages/shared/lib/typings/bridge.ts +++ b/packages/shared/lib/typings/bridge.ts @@ -6,6 +6,7 @@ import type { StrongholdStatus } from './wallet' export interface Actor { destroy(): void + removeEventListeners(): void } export interface CommunicationIds { diff --git a/packages/shared/lib/wallet.ts b/packages/shared/lib/wallet.ts index a4e010ff608..3f171792c80 100644 --- a/packages/shared/lib/wallet.ts +++ b/packages/shared/lib/wallet.ts @@ -137,6 +137,19 @@ export const initialise = (id: string, storagePath: string): void => { actors[id] = actor } +/** + * Removes event listeners for active actor + * + * @method removeEventListeners + * + * @param {string} id + * + * @returns {void} + */ +export const removeEventListeners = (id: string): void => { + actors[id].removeEventListeners() +}; + /** * Destroys an actor & remove it from actors state * diff --git a/packages/shared/routes/dashboard/wallet/Wallet.svelte b/packages/shared/routes/dashboard/wallet/Wallet.svelte index efc91dfee22..9a3bd07fb10 100644 --- a/packages/shared/routes/dashboard/wallet/Wallet.svelte +++ b/packages/shared/routes/dashboard/wallet/Wallet.svelte @@ -7,7 +7,7 @@ import { DEFAULT_NODE, DEFAULT_NODES, network } from 'shared/lib/network' import { showAppNotification } from 'shared/lib/notifications' import { openPopup } from 'shared/lib/popup' - import { isStrongholdLocked } from 'shared/lib/profile' + import { activeProfile, isStrongholdLocked } from 'shared/lib/profile' import { walletRoute } from 'shared/lib/router' import { WalletRoutes } from 'shared/lib/typings/routes' import { @@ -28,6 +28,7 @@ updateBalanceOverview, wallet, WalletAccount, + removeEventListeners } from 'shared/lib/wallet' import { onMount, setContext } from 'svelte' import { derived, Readable, Writable } from 'svelte/store' @@ -353,6 +354,8 @@ getAccounts() } + removeEventListeners($activeProfile.id) + initialiseListeners() api.getStrongholdStatus({ From aa2c878e123f25863a60bc49549e39fc4df05635 Mon Sep 17 00:00:00 2001 From: Umair Sarfraz Date: Fri, 19 Mar 2021 20:23:42 +0100 Subject: [PATCH 11/14] feat: remove unnecessary additions --- packages/shared/lib/wallet.ts | 62 ++++++++++++++--------------------- 1 file changed, 24 insertions(+), 38 deletions(-) diff --git a/packages/shared/lib/wallet.ts b/packages/shared/lib/wallet.ts index 3f171792c80..3d87623b271 100644 --- a/packages/shared/lib/wallet.ts +++ b/packages/shared/lib/wallet.ts @@ -12,7 +12,7 @@ import type { ErrorEventPayload, TransferProgressEventType } from 'shared/lib/ty import type { Message } from 'shared/lib/typings/message' import { formatUnit } from 'shared/lib/units' import type { ApiClient } from 'shared/lib/walletApi' -import { get, writable, Writable, derived } from 'svelte/store' +import { get, writable, Writable } from 'svelte/store' const ACCOUNT_COLORS = ['turquoise', 'green', 'orange', 'yellow', 'purple', 'pink'] @@ -92,10 +92,6 @@ export const wallet = writable({ accountsLoaded: writable(false), }) -export const transactions = derived(get(wallet).accounts, ($accounts) => { - return getLatestMessages($accounts) -}) - export const resetWallet = () => { const { balanceOverview, accounts, accountsLoaded } = get(wallet) balanceOverview.set({ @@ -222,23 +218,18 @@ export const initialiseListeners = () => { const essence = message.payload.data.essence - const walletTransactions = get(transactions); - // if we already have this message on one of the accounts, - // we skip updating incoming/outgoing values. - if (!walletTransactions.some((transaction) => transaction.id === message.id)) { - if (!essence.data.internal) { - const { balanceOverview } = get(wallet); - const overview = get(balanceOverview); - - const incoming = essence.data.incoming ? overview.incomingRaw + essence.data.value : overview.incomingRaw; - const outgoing = essence.data.incoming ? overview.outgoingRaw : overview.outgoingRaw + essence.data.value; - - updateBalanceOverview( - overview.balanceRaw, - incoming, - outgoing - ); - } + if (!essence.data.internal) { + const { balanceOverview } = get(wallet); + const overview = get(balanceOverview); + + const incoming = essence.data.incoming ? overview.incomingRaw + essence.data.value : overview.incomingRaw; + const outgoing = essence.data.incoming ? overview.outgoingRaw : overview.outgoingRaw + essence.data.value; + + updateBalanceOverview( + overview.balanceRaw, + incoming, + outgoing + ); } const notificationMessage = localize('notifications.valueTx') @@ -268,22 +259,17 @@ export const initialiseListeners = () => { const essence = message.payload.data.essence if (response.payload.confirmed && !essence.data.internal) { - const walletTransactions = get(transactions); - // if we already have this message marked as confirmed, - // we skip updating incoming/outgoing values. - if (!walletTransactions.some((transaction) => transaction.id === message.id && transaction.confirmed)) { - const { balanceOverview } = get(wallet); - const overview = get(balanceOverview); - - const incoming = essence.data.incoming ? overview.incomingRaw + essence.data.value : overview.incomingRaw; - const outgoing = essence.data.incoming ? overview.outgoingRaw : overview.outgoingRaw + essence.data.value; - - updateBalanceOverview( - overview.balanceRaw, - incoming, - outgoing - ); - } + const { balanceOverview } = get(wallet); + const overview = get(balanceOverview); + + const incoming = essence.data.incoming ? overview.incomingRaw + essence.data.value : overview.incomingRaw; + const outgoing = essence.data.incoming ? overview.outgoingRaw : overview.outgoingRaw + essence.data.value; + + updateBalanceOverview( + overview.balanceRaw, + incoming, + outgoing + ); } const accountMessage = account.messages.find((_message) => _message.id === message.id) From bef90b43952f1d1157cc2ba9d2e429208a3cd4cc Mon Sep 17 00:00:00 2001 From: Umair Sarfraz Date: Fri, 19 Mar 2021 20:26:01 +0100 Subject: [PATCH 12/14] feat: do not update wallet state through events if syncing is in progress --- packages/shared/lib/wallet.ts | 113 ++++++++++++++++++---------------- 1 file changed, 59 insertions(+), 54 deletions(-) diff --git a/packages/shared/lib/wallet.ts b/packages/shared/lib/wallet.ts index 3d87623b271..3fd626b7172 100644 --- a/packages/shared/lib/wallet.ts +++ b/packages/shared/lib/wallet.ts @@ -218,18 +218,23 @@ export const initialiseListeners = () => { const essence = message.payload.data.essence - if (!essence.data.internal) { - const { balanceOverview } = get(wallet); - const overview = get(balanceOverview); - - const incoming = essence.data.incoming ? overview.incomingRaw + essence.data.value : overview.incomingRaw; - const outgoing = essence.data.incoming ? overview.outgoingRaw : overview.outgoingRaw + essence.data.value; + if (!get(isSyncing)) { + if (!essence.data.internal) { + const { balanceOverview } = get(wallet); + const overview = get(balanceOverview); + + const incoming = essence.data.incoming ? overview.incomingRaw + essence.data.value : overview.incomingRaw; + const outgoing = essence.data.incoming ? overview.outgoingRaw : overview.outgoingRaw + essence.data.value; + + updateBalanceOverview( + overview.balanceRaw, + incoming, + outgoing + ); + } - updateBalanceOverview( - overview.balanceRaw, - incoming, - outgoing - ); + // Update account with new message + saveNewMessage(response.payload.accountId, response.payload.message); } const notificationMessage = localize('notifications.valueTx') @@ -237,9 +242,6 @@ export const initialiseListeners = () => { .replace('{{account}}', account.alias) showSystemNotification({ type: "info", message: notificationMessage }) - - // Update account with new message - saveNewMessage(response.payload.accountId, response.payload.message); }, onError(error) { console.error(error) @@ -258,41 +260,43 @@ export const initialiseListeners = () => { const essence = message.payload.data.essence - if (response.payload.confirmed && !essence.data.internal) { - const { balanceOverview } = get(wallet); - const overview = get(balanceOverview); + if (!get(isSyncing)) { + if (response.payload.confirmed && !essence.data.internal) { + const { balanceOverview } = get(wallet); + const overview = get(balanceOverview); - const incoming = essence.data.incoming ? overview.incomingRaw + essence.data.value : overview.incomingRaw; - const outgoing = essence.data.incoming ? overview.outgoingRaw : overview.outgoingRaw + essence.data.value; + const incoming = essence.data.incoming ? overview.incomingRaw + essence.data.value : overview.incomingRaw; + const outgoing = essence.data.incoming ? overview.outgoingRaw : overview.outgoingRaw + essence.data.value; - updateBalanceOverview( - overview.balanceRaw, - incoming, - outgoing - ); - } + updateBalanceOverview( + overview.balanceRaw, + incoming, + outgoing + ); + } - const accountMessage = account.messages.find((_message) => _message.id === message.id) - accountMessage.confirmed = response.payload.confirmed - accounts.update((storedAccounts) => { - return storedAccounts.map((storedAccount) => { - if (storedAccount.id === account.id) { - return Object.assign, Partial>({} as WalletAccount, storedAccount, { - messages: storedAccount.messages.map((_message: Message) => { - if (_message.id === message.id) { - return Object.assign, Partial>( - {} as Message, - _message, - { confirmed: response.payload.confirmed } - ) - } - return _message + const accountMessage = account.messages.find((_message) => _message.id === message.id) + accountMessage.confirmed = response.payload.confirmed + accounts.update((storedAccounts) => { + return storedAccounts.map((storedAccount) => { + if (storedAccount.id === account.id) { + return Object.assign, Partial>({} as WalletAccount, storedAccount, { + messages: storedAccount.messages.map((_message: Message) => { + if (_message.id === message.id) { + return Object.assign, Partial>( + {} as Message, + _message, + { confirmed: response.payload.confirmed } + ) + } + return _message + }) }) - }) - } - return storedAccount + } + return storedAccount + }) }) - }) + } const notificationMessage = localize(`notifications.${messageKey}`) .replace('{{value}}', formatUnit(message.payload.data.essence.data.value)) @@ -310,17 +314,18 @@ export const initialiseListeners = () => { */ api.onBalanceChange({ onSuccess(response) { - const { payload: { accountId, address, balanceChange } } = response; - - updateAccountAfterBalanceChange(accountId, address, balanceChange.received, balanceChange.spent) - - const { balanceOverview } = get(wallet); - const overview = get(balanceOverview); - - const balance = overview.balanceRaw - balanceChange.spent + balanceChange.received - - updateBalanceOverview(balance, overview.incomingRaw, overview.outgoingRaw); + if (!get(isSyncing)) { + const { payload: { accountId, address, balanceChange } } = response; + updateAccountAfterBalanceChange(accountId, address, balanceChange.received, balanceChange.spent) + + const { balanceOverview } = get(wallet); + const overview = get(balanceOverview); + + const balance = overview.balanceRaw - balanceChange.spent + balanceChange.received + + updateBalanceOverview(balance, overview.incomingRaw, overview.outgoingRaw); + } }, onError(error) { console.error(error) From 0b9ad205b1f711281b796a994ba4269b7dae9a8c Mon Sep 17 00:00:00 2001 From: Charlie Varley Date: Fri, 19 Mar 2021 22:11:18 +0000 Subject: [PATCH 13/14] fix: update wallet.rs commit --- packages/backend/bindings/node/native/Cargo.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/backend/bindings/node/native/Cargo.lock b/packages/backend/bindings/node/native/Cargo.lock index 9f3727eb0b6..7dd34b1c503 100644 --- a/packages/backend/bindings/node/native/Cargo.lock +++ b/packages/backend/bindings/node/native/Cargo.lock @@ -1742,7 +1742,7 @@ dependencies = [ [[package]] name = "iota-wallet" version = "0.1.0" -source = "git+https://github.com/iotaledger/wallet.rs?branch=develop#43f055b4e044ce32a10549a9e134d2386833ed1e" +source = "git+https://github.com/iotaledger/wallet.rs?branch=develop#c867c2c8a194ed8897a28980030b96473e8b23c9" dependencies = [ "async-trait", "backtrace", From b8c210249b76d7dc213f1f8a0534ee323975d981 Mon Sep 17 00:00:00 2001 From: Lucas Nogueira Date: Fri, 19 Mar 2021 23:11:31 -0300 Subject: [PATCH 14/14] fix: transactions store --- packages/shared/routes/dashboard/wallet/Wallet.svelte | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/shared/routes/dashboard/wallet/Wallet.svelte b/packages/shared/routes/dashboard/wallet/Wallet.svelte index 9a3bd07fb10..f0f6695f226 100644 --- a/packages/shared/routes/dashboard/wallet/Wallet.svelte +++ b/packages/shared/routes/dashboard/wallet/Wallet.svelte @@ -17,7 +17,7 @@ BalanceOverview, getAccountMeta, getAccountsBalanceHistory, - transactions, + getLatestMessages, getWalletBalanceHistory, initialiseListeners, isTransferring, @@ -38,6 +38,9 @@ const { accounts, balanceOverview, accountsLoaded } = $wallet + const transactions = derived(accounts, ($accounts) => { + return getLatestMessages($accounts) + }) const accountsBalanceHistory = derived([accounts, priceData], ([$accounts, $priceData]) => getAccountsBalanceHistory($accounts, $priceData) )