Skip to content

Commit

Permalink
Fix lint issues
Browse files Browse the repository at this point in the history
  • Loading branch information
mike-metaplex committed Nov 1, 2022
1 parent 4a7d9f6 commit 0df2c6a
Show file tree
Hide file tree
Showing 9 changed files with 15 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import Solana
extension TransactionBuilder {
static func createBidBuilder(parameters: CreateBidBuilderParameters) -> TransactionBuilder {
// MARK: - Accounts

let buyAccounts = BuyAccounts(
wallet: parameters.wallet,
paymentAccount: parameters.paymentAccount,
Expand Down Expand Up @@ -112,7 +112,7 @@ extension TransactionBuilder {

// MARK: - Create Token Account Instruction

// TODO: Create an account if it doesn't exist. Will come back to this as there's a bit involved.
#warning("Create an account if it doesn't exist. Will come back to this as there's a bit involved.")

// MARK: - Transaction Builder

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ struct CancelListingBuilderParameters {
}
var receipt: PublicKey? { cancelListingInput.listing.listingReceipt.receipt?.publicKey }


// MARK: - Args

var price: UInt64 { cancelListingInput.listing.listingReceipt.price }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ class CreateAuctionHouseOperationHandler: OperationHandler {
callback(.failure(.confirmTransactionError(error)))
}
}
}.flatMap { status in
}.flatMap { _ in
OperationResult<Auctionhouse, OperationError>.init { callback in
self.metaplex.auctionHouse.findByAddress(parameters.auctionHouse) { callback($0) }
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class FindAuctionHouseByCreatorAndMintOperationHandler: OperationHandler {
OperationResult.pure(Auctionhouse.pda(creator: input.creator, treasuryMint: input.treasuryMint)).flatMap { address in
OperationResult<Auctionhouse, Error>.init { callback in
self.metaplex.auctionHouse.findByAddress(address.publicKey) { result in
callback(result.mapError { $0 } )
callback(result.mapError { $0 })
}
}
}.mapError { OperationError.findAuctionHouseByCreatorAndMintError($0) }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ class CreateBidOperationHandler: OperationHandler {
callback(.failure(.confirmTransactionError(error)))
}
}
}.flatMap { status in
}.flatMap { _ in
OperationResult<Bid, OperationError>.init { callback in
if let receipt = parameters.receipt {
self.metaplex.auctionHouse.findBidByReceipt(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,9 @@ class FindBidsByPublicKeyFieldOperationHandler: OperationHandler {
case .metadata(let address):
query = query.whereMetadata(address: address)
case .mint(let mintKey):
guard let address = try? MetadataAccount.pda(mintKey: mintKey).get() else { return .failure(OperationError.couldNotFindPDA) }
guard let address = try? MetadataAccount.pda(mintKey: mintKey).get()
else { return .failure(OperationError.couldNotFindPDA) }

query = query.whereMetadata(address: address)
}
return query.getAndMap { (accounts: [AccountInfoWithPureData]) in
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ class CreateListingOperationHandler: OperationHandler {
callback(.failure(.confirmTransactionError(error)))
}
}
}.flatMap { status in
}.flatMap { _ in
OperationResult<Listing, OperationError>.init { callback in
if let receipt = parameters.receipt {
self.metaplex.auctionHouse.findListingByReceipt(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ class ExecuteSaleOperationHandler: OperationHandler {
callback(.failure(.confirmTransactionError(error)))
}
}
}.flatMap { status in
}.flatMap { _ in
OperationResult<Purchase, OperationError>.init { callback in
if let receipt = parameters.receipt {
self.metaplex.auctionHouse.findPurchaseByReceipt(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,11 @@ class FindPurchaseByReceiptOperationHandler: OperationHandler {
.mapError { OperationError.findPurchaseByReceiptError($0) }
.flatMap { purchaseReceipt in
OperationResult<Purchase, OperationError>.init { callback in
let lazyPurchase = LazyPurchase(auctionHouse: input.auctionHouse, purchaseReceipt: purchaseReceipt, publicKey: input.address)
let lazyPurchase = LazyPurchase(
auctionHouse: input.auctionHouse,
purchaseReceipt: purchaseReceipt,
publicKey: input.address
)
self.metaplex.auctionHouse.loadPurchase(lazyPurchase) {
callback($0)
}
Expand Down

0 comments on commit 0df2c6a

Please sign in to comment.