Skip to content

Add generic redeemRewards function ; removed redundant code #517

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

Merged
merged 2 commits into from
Jul 23, 2020

Conversation

roienatan
Copy link
Contributor

Resolves: #516

This PR is necessary to solve issue daostack/alchemy#1993 in Alchemy

Comment on lines 802 to 805
if (state.name === 'ContributionReward') {
const pluginState = await state.plugin.entity.fetchState()
pluginAddress = pluginState.address
} else {
Copy link
Contributor

Choose a reason for hiding this comment

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

why this condition is needed ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The old functions are not exactly the same - they are similar but not the same. There is a different in the way pluginAddress is fetched between the functions and we need to distinguish between the ways. Without this condition some of the tests fail.

Copy link
Contributor

Choose a reason for hiding this comment

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

there is a need to understand why this behave differently .
does pluginAddress get different value for different cases ? why ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes it gets a different value when state.name is ContributionReward or different.

).address
}
let method
if (state.name === 'ContributionRewardExt') {
Copy link
Contributor

Choose a reason for hiding this comment

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

if ((state.name === 'ContributionRewardExt') || (state.name === 'Competition')) {

see https://github.com/daostack/arc.js/pull/517/files#diff-d715962a7a35c4a5cc171d759e923469L214

Copy link
Contributor

@orenyodfat orenyodfat left a comment

Choose a reason for hiding this comment

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

please bump version.

@roienatan roienatan merged commit e3040cc into client-2-0 Jul 23, 2020
@roienatan roienatan deleted the generic-redeemRewards branch July 23, 2020 10:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants