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

Add default values for hive fields for Node, UnspentCoinsInfo, Wallet… #598

Merged
merged 2 commits into from
Nov 4, 2022

Conversation

mkyq
Copy link
Contributor

@mkyq mkyq commented Nov 4, 2022

…Info, Order, Contact, TransactionDescription, Trade

…Info, Order, Contact, TransactionDescription, Trade
@mkyq mkyq requested a review from OmarHatem28 November 4, 2022 19:23
@mkyq mkyq merged commit 5d741b1 into main Nov 4, 2022
@mkyq mkyq deleted the add-default-values-for-some-hive-types branch November 4, 2022 19:55
Comment on lines 42 to 43
@HiveField(2)
WalletType type;
Copy link
Contributor

Choose a reason for hiding this comment

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

is this guaranteed it won't be null?

Comment on lines +45 to 46
@HiveField(4, defaultValue: '')
late String stateRaw;
Copy link
Contributor

Choose a reason for hiding this comment

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

with the current implementation of the constructor, this variable may not be initialized if the state is null, resulting in a late variable not initialized exception

Comment on lines +62 to 63
@HiveField(9, defaultValue: 0)
late int providerRaw;
Copy link
Contributor

Choose a reason for hiding this comment

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

with the current implementation of the constructor, this variable may not be initialized if the provider is null, resulting in a late variable not initialized exception

Comment on lines +26 to 27
@HiveField(2, defaultValue: 0)
late int raw;
Copy link
Contributor

Choose a reason for hiding this comment

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

with the current implementation of the constructor, this variable may not be initialized if the type is null, resulting in a late variable not initialized exception

Comment on lines +46 to 47
@HiveField(1, defaultValue: 0)
late int providerRaw;
Copy link
Contributor

Choose a reason for hiding this comment

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

same

Comment on lines +52 to 63
@HiveField(2, defaultValue: 0)
late int fromRaw;

CryptoCurrency get from => CryptoCurrency.deserialize(raw: fromRaw);

@HiveField(3)
@HiveField(3, defaultValue: 0)
late int toRaw;

CryptoCurrency get to => CryptoCurrency.deserialize(raw: toRaw);

@HiveField(4)
@HiveField(4, defaultValue: '')
late String stateRaw;
Copy link
Contributor

Choose a reason for hiding this comment

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

same

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.

2 participants