Skip to content

Commit

Permalink
test: add unit tests for the classic asset handler
Browse files Browse the repository at this point in the history
  • Loading branch information
fazzatti committed Apr 5, 2024
1 parent c52b00e commit 52001e5
Show file tree
Hide file tree
Showing 2 changed files with 448 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/stellar-plus/asset/classic/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { Horizon as HorizonNamespace, Operation, Asset as StellarAsset } from '@stellar/stellar-sdk'

import { HorizonHandler } from 'stellar-plus'
import { AccountHandler } from 'stellar-plus/account/account-handler/types'
import {
ClassicAssetHandlerConstructorArgs,
Expand All @@ -10,6 +9,7 @@ import { AssetTypes } from 'stellar-plus/asset/types'
import { ClassicTransactionPipeline } from 'stellar-plus/core/pipelines/classic-transaction'
import { ClassicTransactionPipelineOptions } from 'stellar-plus/core/pipelines/classic-transaction/types'
import { TransactionInvocation } from 'stellar-plus/core/types'
import { HorizonHandlerClient as HorizonHandler } from 'stellar-plus/horizon'

import { CAHError } from './errors'

Expand All @@ -21,7 +21,7 @@ export class ClassicAssetHandler implements IClassicAssetHandler {
private asset: StellarAsset
private horizonHandler: HorizonHandler

private classicTrasactionPipeline: ClassicTransactionPipeline
private classicTransactionPipeline: ClassicTransactionPipeline

/**
*
Expand Down Expand Up @@ -53,7 +53,7 @@ export class ClassicAssetHandler implements IClassicAssetHandler {

this.asset = new StellarAsset(args.code, this.issuerPublicKey)

this.classicTrasactionPipeline = new ClassicTransactionPipeline(
this.classicTransactionPipeline = new ClassicTransactionPipeline(
args.networkConfig,
args.options?.classicTransactionPipeline as ClassicTransactionPipelineOptions
)
Expand Down Expand Up @@ -150,7 +150,7 @@ export class ClassicAssetHandler implements IClassicAssetHandler {
source: from,
})

await this.classicTrasactionPipeline.execute({
await this.classicTransactionPipeline.execute({
txInvocation,
operations: [transferOp],
})
Expand Down Expand Up @@ -219,7 +219,7 @@ export class ClassicAssetHandler implements IClassicAssetHandler {
source: this.asset.getIssuer(),
})

const result = await this.classicTrasactionPipeline.execute({
const result = await this.classicTransactionPipeline.execute({
txInvocation: updatedTxInvocation,
operations: [mintOp],
})
Expand Down Expand Up @@ -278,7 +278,7 @@ export class ClassicAssetHandler implements IClassicAssetHandler {
source: this.asset.getIssuer(),
})

const result = await this.classicTrasactionPipeline.execute({
const result = await this.classicTransactionPipeline.execute({
txInvocation: updatedTxInvocation,
operations: [addTrustlineOp, mintOp],
})
Expand Down Expand Up @@ -311,7 +311,7 @@ export class ClassicAssetHandler implements IClassicAssetHandler {
asset: this.asset,
})

const result = await this.classicTrasactionPipeline.execute({
const result = await this.classicTransactionPipeline.execute({
txInvocation,
operations: [addTrustlineOp],
})
Expand Down
Loading

0 comments on commit 52001e5

Please sign in to comment.