Skip to content

Commit

Permalink
Rename method
Browse files Browse the repository at this point in the history
  • Loading branch information
JoelBCarter committed Sep 20, 2024
1 parent a418e9f commit 86c5aea
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,10 @@ import type {
* @param party The party
* @returns The log prefix for the party
*/
const getLogPrefix = (party: EscrowParty) => party === 'seller' ? 'EscrowTerms.sellerSecret' : 'EscrowTerms.buyerSecret'
const getLogPrefix = (party: EscrowParty) => {
const partySecret: EscrowPartySecret = party === 'seller' ? 'sellerSecret' : 'buyerSecret'
return `EscrowTerms.${partySecret}`
}

/**
* Returns an array of BoundWitnesses containing the secret signed by all the parties
Expand All @@ -21,7 +24,7 @@ const getLogPrefix = (party: EscrowParty) => party === 'seller' ? 'EscrowTerms.s
* @param party The party to get the secret signatures for
* @returns An array of BoundWitnesses containing the secret signed by all the parties
*/
export const getEscrowPartySecretSignatures = (terms: EscrowTerms, dictionary: Record<Hash, WithMeta<Payload>>, party: EscrowParty) => {
export const findEscrowPartySecretSignatures = (terms: EscrowTerms, dictionary: Record<Hash, WithMeta<Payload>>, party: EscrowParty) => {
const partyAddresses = assertEx(terms[party], () => `${getLogPrefix(party)}: No ${party}: ${terms[party]}`)
const partySecret: EscrowPartySecret = party === 'seller' ? 'sellerSecret' : 'buyerSecret'
const secretHash = assertEx(terms[partySecret], () => `${getLogPrefix(party)}: No ${partySecret}: ${terms[partySecret]}`)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
export * from './createEscrowIntent.ts'
export * from './getEscrowPartySecretSignatures.ts'
export * from './findEscrowPartySecretSignatures.ts'
export * from './getEscrowSecret.ts'

0 comments on commit 86c5aea

Please sign in to comment.