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

[WIP] Add bindings for Karma proto #203

Closed
wants to merge 2 commits into from
Closed

[WIP] Add bindings for Karma proto #203

wants to merge 2 commits into from

Conversation

gakonst
Copy link
Contributor

@gakonst gakonst commented Jan 21, 2019

Proto bindings from loomnetwork/go-loom#190

Karma contract bindings from loomnetwork/loomchain#466

Closes #197

@gakonst gakonst changed the title Add bindings for Karma proto [WIP] Add bindings for Karma proto Jan 21, 2019

export class Karma extends Contract {
static async createAsync(client: Client, callerAddr: Address): Promise<DPOS> {
const contractAddr = await client.getContractAddressAsync('dpos')
Copy link
Contributor

Choose a reason for hiding this comment

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

lol, copy/pasta

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Busted lol

}

async depositCoinAsync(amount: BN, from: Address): Promise<void> {
const karmaUserAmountReq = new KarmaUserAmount()
Copy link
Contributor

Choose a reason for hiding this comment

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

KarmaUserAmount gah. nvm. I'll fix it later.


async getUserKarmaAsync(user: Address, target: KarmaSourceTarget): Promise<KarmaTotal> {
const karmaUserTargetReq = new KarmaUserTarget()
let response: any
Copy link
Contributor

Choose a reason for hiding this comment

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

This should be a protobuf instance?

Copy link
Contributor Author

@gakonst gakonst Jan 21, 2019

Choose a reason for hiding this comment

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

Yeah, I wanna add a new proto response and wrap it inside, as we do in other places, but the current karma implementation returns the data directly.

}

async getSourcesAsync(user: Address): Promise<KarmaSources> {
let response: any
Copy link
Contributor

Choose a reason for hiding this comment

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

This should be a protobuf instance?

}

async getUserStateAsync(user: Address): Promise<KarmaState> {
let response: any
Copy link
Contributor

Choose a reason for hiding this comment

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

This should be a protobuf instance?

@gakonst gakonst closed this Aug 15, 2019
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.

Add bindings for Karma contract
2 participants