Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support asset field in BaseTransaction - Closes #3697 #3698

Merged
merged 11 commits into from Jun 28, 2019

Conversation

MaciejBaj
Copy link
Contributor

@MaciejBaj MaciejBaj commented May 22, 2019

What was the problem?

Each time while defining a transaction extending BasicTransaction there is a need for implementing the complex constructor supporting the asset field and assetToJSON function which is the same for all transaction types.

How did I fix it?

  • assign asset field in the constructor of BasicTransaction
  • implement default assetToJSON method in BasicTransaction

How to test it?

Review checklist

Copy link
Contributor Author

@MaciejBaj MaciejBaj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will remove the overridden implementation from the default transaction types. The implementation is the same. Setting to in progress

Signed-off-by: Maciej Baj <macie.baj@gmail.com>
Signed-off-by: Maciej Baj <macie.baj@gmail.com>
elements/lisk-transactions/src/utils/asset.ts Outdated Show resolved Hide resolved
elements/lisk-transactions/src/utils/asset.ts Outdated Show resolved Hide resolved
elements/lisk-transactions/src/utils/asset.ts Outdated Show resolved Hide resolved
elements/lisk-transactions/src/utils/asset.ts Outdated Show resolved Hide resolved
elements/lisk-transactions/src/utils/asset.ts Outdated Show resolved Hide resolved
elements/lisk-transactions/src/utils/asset.ts Outdated Show resolved Hide resolved
@MaciejBaj MaciejBaj force-pushed the 3697-support_asset_in_base_trs branch from f9e5505 to 2f4a95a Compare June 24, 2019 06:48
@MaciejBaj
Copy link
Contributor Author

@shuse2 @SargeKhan I would prefer to keep the simplest version accepting the risk of possible confusion in the case of non-deterministic order of keys in assets. The proper research is currently ongoing. I added the relevant FixMe to the assetToBytes function.

@shuse2
Copy link
Member

shuse2 commented Jun 28, 2019

For 2.1, we will go with this temporal solution, but it should be mentioned in the documentation that we strongly recommend to override this assetToBytes @MaciejBaj

@shuse2 shuse2 merged commit 92ab01a into release/2.1.0 Jun 28, 2019
@shuse2 shuse2 deleted the 3697-support_asset_in_base_trs branch June 28, 2019 12:12
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.

None yet

4 participants