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

Actions implementation are currently quite wet, make them DRY #838

Closed
LLFourn opened this issue Apr 2, 2019 · 0 comments

Comments

Projects
None yet
3 participants
@LLFourn
Copy link
Contributor

commented Apr 2, 2019

We do a lot of repeating ourselves when we impl Actions like impl Actions for alice::State<Bitcoin, Ethereum, BitcoinQuantity, EtherQuantity>. We do this for every Ledger/Asset pair. We actually only need to specify (deploy, fund,redeem, reufund) for each Ledger and Asset combination. Then we could impl them all in one go:

impl<AL,BL,BA,AA> Actions for alice::State<AL,BL,BA,AA>
  where (AL,AA)::DoesSomeTrait, (BL,BB)::DoesSomeTrait {
    // ... then when you need to generate the action for alpha funding:
   alice::ActionKind::Fund((AL,AA)::fund_action(&request, &response))
}

@thomaseizinger thomaseizinger changed the title DRY Actions implementation Actions implementation are currently quite wet, make them DRY Apr 2, 2019

@D4nte D4nte added groomed and removed groomed labels Apr 10, 2019

@bonomat bonomat self-assigned this Apr 17, 2019

@bonomat bonomat added review and removed work-in-progress labels Apr 23, 2019

@D4nte D4nte added this to the Sprint 12 🏅🏃‍♂️ milestone Apr 24, 2019

@bonomat bonomat removed the review label Apr 29, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.