Skip to content

feat: ignoring genesis transactions before sending them to the wallet…#5

Merged
andreabadesso merged 1 commit into
devfrom
feat/ignore-genesis-txs
May 23, 2021
Merged

feat: ignoring genesis transactions before sending them to the wallet…#5
andreabadesso merged 1 commit into
devfrom
feat/ignore-genesis-txs

Conversation

@andreabadesso
Copy link
Copy Markdown
Collaborator

We are already doing this on the wallet service, but the wallet service will throw an error, causing the daemon to stop sending blocks.

With this PR, the daemon will not even send the transaction if it is a genesis tx

@andreabadesso andreabadesso requested review from msbrogli and pedroferreira1 and removed request for pedroferreira1 May 17, 2021 18:57
@andreabadesso andreabadesso self-assigned this May 17, 2021
Comment thread src/utils.ts
Comment thread src/utils.ts
Comment thread src/utils.ts Outdated
@andreabadesso andreabadesso force-pushed the feat/ignore-genesis-txs branch from feb221d to 0ca0ec3 Compare May 23, 2021 15:48
@andreabadesso andreabadesso merged commit 7bcdcf7 into dev May 23, 2021
@andreabadesso andreabadesso deleted the feat/ignore-genesis-txs branch May 23, 2021 15:50
andreabadesso added a commit that referenced this pull request May 24, 2021
* feat: initial commit

* feat: using generator to download blocks to be able to cancel it when state changes

* chore: updated package.json, lock and tsconfig

* chore: removed .env from git

* feat: resetting blocks on syncing state entry and moving to idle when receiving NEW_BLOCK event'

* feat: checking if our best block is still valid (not voided) before continuing)

* refactor: handling errors better by yielding instead of throwing

* refactor: using bi-directional callbacks on state machine instead of an activity

* feat: using hathorLib Connection class to maintain a connection to the fullnode

* feat: starting the state machine only on START event

* feat: added type to generator and yields

* feat: added tests for utils methods

* refactor: moved state machine methods to a dedicated file

* fix: typo when parsing outputs

* feat: added tests for the state machine

* chore: added baseUrl to prevent warnings

* feat: transition to reorg when a reorg is detected

* docs: added README

* feat: getting NETWORK from env var

* fix: handling lambda call failures

* chore: removed size.yml github action (came from tsdx template)

* docs: added comment explaining the block sync strategy on ws events

* docs: added comment explaining state updates from ws conn

* chore: removed unused and commented import on machine and commented unused sync event type

* docs: added comment on the machine refering to the README

* refactor: getting constant from hathor-lib and removed useless commented block code

* feat: typed prepareTx

* fix: returning success false if a failure has ocurred inside the tx loop

* fix: added missing attributes to PreparedTx type

* docs: added docstring to util methods

* feat: using a LRU cache for transactions

* refactor: removed misleading log

* feat: loading wallet_service_local_url from env variables

* docs: added a TODO to replace the getFullNodeBestBlock API

* fix: added missing type to sendTx parameter

* fix: added missing types and fixed lint on LRU cache

* Added dockerfile to the project (#4)

* chore: added dockerfile

* chore: removed global tsdx from dockerfile

* docs: added a simple explaination on how to run locally, build and run a production service

* chore: updated state machine diagram URL to render automatically

* docs: added missing hathor header

* feat: added winston as a logger and refactored console.logs to use it

* refactor: moved api methods to src/api

* fix: winston import breaking production build

* refactor: using wallet util method to get token index

* refactor: changed reorg message

* refactor: improved blocks download message

* refactor: using a better algorithm to filter unique txs

* docs: added comment explaining Map queue order

* fix: typo

* feat: typed yield result from generator

* feat: added type and docstring to onReceive from syncHandler

* refactor: using strict, refactor types to pass tslint

* fix: token creation tx was not sending token_name and token_symbol

* fix: breaking type on fullnode response

* feat: logging full data instead of data.Response on lambda response

* tests: removed isVoided from tx

* tests: fix typo on tests, clearing all mocks before every test instead of 'beforeAll'

* tests: fix test by using the hathorLib to define whether a tx is a block or not

* feat: typed raw tx response from fullnode

* refactor: typed rawTx and refactored types

* chore: set build output to cjs as the project is node-only

* chore: removed dom from lib

* feat: added spent_by and token to RawOutput and RawInput to handle block_at_height response format

* chore: ignoring some ts errors that can be handled by typing for now.

* chore: using strict: true

* feat: ignoring genesis transactions before sending them to the wallet-service (#5)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants