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

[PVM] Added missing condition for claimtx in SelectTxClass #67

Merged
merged 1 commit into from
Apr 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/apis/platformvm/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2508,7 +2508,7 @@ export class PlatformVMAPI extends JRPCAPI {
*/
buildClaimTx = async (
utxoset: UTXOSet,
fromAddresses: string[],
fromAddresses: FromType,
changeAddresses: string[] = undefined,
memo: PayloadBase | Buffer = undefined,
asOf: BN = ZeroBN,
Expand Down
3 changes: 2 additions & 1 deletion src/apis/platformvm/builder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1438,8 +1438,9 @@ export class Builder {
* @param depositTxIDs The deposit transactions ids with which the claiblable rewards are associated
* @param claimableOwnerIDs The ownerIDs of the rewards to claim
* @param claimedAmounts The amounts of the rewards to claim
* @param claimType The type of claim tx
* @param claimTo The address to claimed rewards will be directed to
* @param claimType The type of claim tx
* @param claimableSigners The signers of the claimable rewards
*
* @returns An unsigned ClaimTx created from the passed in parameters.
*/
Expand Down
3 changes: 3 additions & 0 deletions src/apis/platformvm/tx.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ import { TransactionError } from "../../utils/errors"
import { RegisterNodeTx } from "./registernodetx"
import { DepositTx } from "./depositTx"
import { AddressStateTx } from "./addressstatetx"
import { ClaimTx } from "./claimtx"

/**
* @ignore
Expand Down Expand Up @@ -63,6 +64,8 @@ export const SelectTxClass = (txtype: number, ...args: any[]): BaseTx => {
return new DepositTx(...args)
} else if (txtype === PlatformVMConstants.ADDRESSSTATETX) {
return new AddressStateTx(...args)
} else if (txtype === PlatformVMConstants.CLAIMTX) {
return new ClaimTx(...args)
}
/* istanbul ignore next */
throw new TransactionError("Error - SelectTxClass: unknown txtype")
Expand Down