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

Fix: better getUnspent #143

Merged
merged 9 commits into from
Sep 2, 2019
Merged

Fix: better getUnspent #143

merged 9 commits into from
Sep 2, 2019

Conversation

troggy
Copy link
Member

@troggy troggy commented Aug 30, 2019

@troggy troggy mentioned this pull request Aug 30, 2019
8 tasks
required arg can't go after the optional one
@sunify sunify self-requested a review September 2, 2019 11:53
Copy link
Member

@sunify sunify left a comment

Choose a reason for hiding this comment

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

Looks good.

Maybe we should have deprecation warning for getUnspentAll (by wrapper similar to https://github.com/leapdao/leap-core/blob/master/lib/helpers.js#L114), but not so important IMO

index.d.ts Outdated
@@ -327,8 +327,8 @@ declare module "leap-core" {
};

class ExtendedWeb3 extends Web3 {
public getUnspent(address: string, color: number, cb?: Callback<Array<Unspent>>): Promise<Array<Unspent>>;
public getUnspent(address: string, cb?: Callback<Array<Unspent>>): Promise<Array<Unspent>>;
public getUnspent(address: string | undefined, color: number, cb?: Callback<Array<Unspent>>): Promise<Array<Unspent>>;
Copy link
Member

Choose a reason for hiding this comment

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

What about token address instead of color?

Copy link
Member

Choose a reason for hiding this comment

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

address: string | undefined | null will be better (you use it with null in docs)

Copy link
Member Author

Choose a reason for hiding this comment

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

both are great points!

@troggy troggy requested a review from sunify September 2, 2019 13:39
Copy link
Member

@sunify sunify left a comment

Choose a reason for hiding this comment

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

🎉

@troggy troggy merged commit 37c1819 into master Sep 2, 2019
@troggy troggy deleted the fix/better-get-unspent branch September 2, 2019 14:29
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