Skip to content
This repository has been archived by the owner on Jun 7, 2019. It is now read-only.

Remove asset field from base transaction - Closes #989 #990

Merged

Conversation

shuse2
Copy link
Contributor

@shuse2 shuse2 commented Jan 9, 2019

What was the problem?

In order to make the base transaction more flexible yet type safe, asset should not be defined in the base transaction.

How did I fix it?

Remove the asset field from the base transaction

Review checklist

@shuse2 shuse2 self-assigned this Jan 9, 2019
@shuse2 shuse2 requested review from SargeKhan and mitsuaki-u January 9, 2019 14:44
@shuse2 shuse2 changed the title 🔥 Remove asset field from base transaction Remove asset field from base transaction - Closes #989 Jan 9, 2019
@shuse2 shuse2 force-pushed the 989-remove_asset_from_base branch from 9a493de to 1b400b1 Compare January 10, 2019 12:53
@@ -101,7 +98,7 @@ export abstract class BaseTransaction {
this.receivedAt = rawTransaction.receivedAt;
}

public abstract assetToJSON(): TransactionAsset;
public abstract assetToJSON(): object;
Copy link
Contributor

Choose a reason for hiding this comment

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

Why is it no longer of type TransactionAsset?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Since asset type is defined in each child transaction, we can't expect it to be specific type.
Maybe we can use generics here, but it's only used in this class, so it wont make much sense?

@shuse2 shuse2 force-pushed the 989-remove_asset_from_base branch from 1b400b1 to da34780 Compare January 10, 2019 17:23
@SargeKhan SargeKhan merged commit 6f653b3 into transaction_improvement_experiment Jan 11, 2019
@SargeKhan SargeKhan deleted the 989-remove_asset_from_base branch January 11, 2019 10:55
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants