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

Replacing asserts with explicit errors + more #702

Merged
merged 3 commits into from
Sep 3, 2022
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
134 changes: 86 additions & 48 deletions bubblegum/js/idl/bubblegum.json

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions bubblegum/js/src/generated/accounts/Voucher.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import { LeafSchema, leafSchemaBeet } from '../types/LeafSchema'
export type VoucherArgs = {
leafSchema: LeafSchema
index: number
merkleSlab: web3.PublicKey
merkleTree: web3.PublicKey
}

export const voucherDiscriminator = [191, 204, 149, 234, 213, 165, 13, 65]
Expand All @@ -33,14 +33,14 @@ export class Voucher implements VoucherArgs {
private constructor(
readonly leafSchema: LeafSchema,
readonly index: number,
readonly merkleSlab: web3.PublicKey
readonly merkleTree: web3.PublicKey
) {}

/**
* Creates a {@link Voucher} instance from the provided args.
*/
static fromArgs(args: VoucherArgs) {
return new Voucher(args.leafSchema, args.index, args.merkleSlab)
return new Voucher(args.leafSchema, args.index, args.merkleTree)
}

/**
Expand Down Expand Up @@ -146,7 +146,7 @@ export class Voucher implements VoucherArgs {
return {
leafSchema: this.leafSchema.__kind,
index: this.index,
merkleSlab: this.merkleSlab.toBase58(),
merkleTree: this.merkleTree.toBase58(),
}
}
}
Expand All @@ -165,7 +165,7 @@ export const voucherBeet = new beet.FixableBeetStruct<
['accountDiscriminator', beet.uniformFixedSizeArray(beet.u8, 8)],
['leafSchema', leafSchemaBeet],
['index', beet.u32],
['merkleSlab', beetSolana.publicKey],
['merkleTree', beetSolana.publicKey],
],
Voucher.fromArgs,
'Voucher'
Expand Down
Loading