Skip to content

Commit c2684c5

Browse files
committed
Fix issues brought up by copilot
1 parent 34e1fe9 commit c2684c5

7 files changed

Lines changed: 9 additions & 12 deletions

File tree

src/predicate/embedded/UnmaskedPredicate.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -117,9 +117,7 @@ export class UnmaskedPredicate extends DefaultPredicate {
117117
}
118118

119119
/**
120-
* Convert predicate to CBOR bytes.
121-
*
122-
* @return CBOR bytes
120+
* @inheritDoc
123121
*/
124122
public getReference(): Promise<UnmaskedPredicateReference> {
125123
return UnmaskedPredicateReference.create(this.tokenType, this.signingAlgorithm, this.publicKey, this.hashAlgorithm);

src/token/Token.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,9 @@ export class Token<R extends IMintTransactionReason> {
9090
public static async fromCBOR(bytes: Uint8Array): Promise<Token<IMintTransactionReason>> {
9191
const data = CborDeserializer.readArray(bytes);
9292

93-
if (CborDeserializer.readTextString(data[0]) !== TOKEN_VERSION) {
94-
throw new Error(`Unsupported token version: ${CborDeserializer.readTextString(data[4])}`);
93+
const version = CborDeserializer.readTextString(data[0]);
94+
if (version !== TOKEN_VERSION) {
95+
throw new Error(`Unsupported token version: ${version}`);
9596
}
9697

9798
return new Token(

src/token/fungible/SplitMintReasonProof.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,6 @@ export class SplitMintReasonProof {
6565
}
6666

6767
public toCBOR(): Uint8Array {
68-
return CborSerializer.encodeArray(this.aggregationPath.toCBOR(), this.coinTreePath.toCBOR());
68+
return CborSerializer.encodeArray(this.coinId.toCBOR(), this.aggregationPath.toCBOR(), this.coinTreePath.toCBOR());
6969
}
7070
}

src/transaction/TransferTransaction.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,7 @@ export interface ITransferTransactionJson {
1717
}
1818

1919
/**
20-
* Mint transaction.
21-
*
22-
* @param <R> mint reason
20+
* Represents a transfer transaction, including its data and inclusion proof.
2321
*/
2422
export class TransferTransaction extends Transaction<TransferTransactionData> {
2523
public constructor(data: TransferTransactionData, inclusionProof: InclusionProof) {

src/verification/CompositeVerificationRule.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ export abstract class CompositeVerificationRule<C extends IVerificationContext>
4040
}
4141

4242
public async verify(context: C): Promise<VerificationResult> {
43-
let rule: VerificationRule<IVerificationContext> | null = this.firstRule;
43+
let rule: VerificationRule<C> | null = this.firstRule;
4444
const results: VerificationResult[] = [];
4545

4646
while (rule != null) {

src/verification/VerificationResult.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ export class VerificationResult {
4444
public toString(): string {
4545
return dedent`
4646
VerificationResult:
47-
isSuccessful: ${this.status}
47+
status: ${this.status}
4848
message: ${this.message}
4949
results: ${this.results.map((result) => result.toString()).join('\n')}
5050
`;

tests/token/CommonTestFlow.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,7 @@ export async function testSplitFlowAfterTransfer(
290290
const mintTokenData = await createMintData(initialOwnerSecret, coinData);
291291
const token = await mintToken(trustBase, client, mintTokenData);
292292

293-
// Perfrom 1st split
293+
// Perform 1st split
294294
const coinsPerNewTokens = [
295295
TokenCoinData.create([
296296
[unicityToken, 50n],

0 commit comments

Comments
 (0)