-
Notifications
You must be signed in to change notification settings - Fork 47
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
Conversation
|
||
export class Karma extends Contract { | ||
static async createAsync(client: Client, callerAddr: Address): Promise<DPOS> { | ||
const contractAddr = await client.getContractAddressAsync('dpos') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lol, copy/pasta
There was a problem hiding this comment.
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() |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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?
Proto bindings from loomnetwork/go-loom#190
Karma contract bindings from loomnetwork/loomchain#466
Closes #197