Skip to content

Commit

Permalink
Merge pull request #128 from nervina-labs/update-default-witness
Browse files Browse the repository at this point in the history
Update default witness
  • Loading branch information
duanyytop authored Jun 6, 2022
2 parents ecfe533 + 31d0cbe commit 79b5bae
Show file tree
Hide file tree
Showing 11 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@nervina-labs/cota-sdk",
"version": "0.5.5",
"version": "0.5.6",
"description": "The SDK of CoTA",
"repository": "[email protected]:nervina-labs/cota-sdk-js.git",
"author": "duanyytop <[email protected]>",
Expand Down
2 changes: 1 addition & 1 deletion src/service/cota/claim-update.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ export const generateClaimUpdateCotaTx = async (
witnesses: [],
}
rawTx.witnesses = rawTx.inputs.map((_, i) =>
i > 0 ? '0x' : { lock: '', inputType: `0x07${claimUpdateSmtEntry}`, outputType: '' },
i > 0 ? '' : { lock: '', inputType: `0x07${claimUpdateSmtEntry}`, outputType: '' },
)
return rawTx
}
2 changes: 1 addition & 1 deletion src/service/cota/claim.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ export const generateClaimCotaTx = async (
witnesses: [],
}
rawTx.witnesses = rawTx.inputs.map((_, i) =>
i > 0 ? '0x' : { lock: '', inputType: `0x04${claimSmtEntry}`, outputType: '' },
i > 0 ? '' : { lock: '', inputType: `0x04${claimSmtEntry}`, outputType: '' },
)
return rawTx
}
2 changes: 1 addition & 1 deletion src/service/cota/define.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ export const generateDefineCotaTx = async (
witnesses: [],
}
rawTx.witnesses = rawTx.inputs.map((_, i) =>
i > 0 ? '0x' : { lock: '', inputType: `0x01${defineSmtEntry}`, outputType: generateCotaMetadata(cotaInfo, cotaId) },
i > 0 ? '' : { lock: '', inputType: `0x01${defineSmtEntry}`, outputType: generateCotaMetadata(cotaInfo, cotaId) },
)
return { rawTx, cotaId }
}
2 changes: 1 addition & 1 deletion src/service/cota/isssuer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ export const generateIssuerInfoTx = async (
witnesses: [],
}
rawTx.witnesses = rawTx.inputs.map((_, i) =>
i > 0 ? '0x' : { lock: '', inputType: '', outputType: generateIssuerMetadata(issuerInfo) },
i > 0 ? '' : { lock: '', inputType: '', outputType: generateIssuerMetadata(issuerInfo) },
)
return rawTx
}
2 changes: 1 addition & 1 deletion src/service/cota/mint.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ export const generateMintCotaTx = async (
witnesses: [],
}
rawTx.witnesses = rawTx.inputs.map((_, i) =>
i > 0 ? '0x' : { lock: '', inputType: `0x02${mintSmtEntry}`, outputType: '' },
i > 0 ? '' : { lock: '', inputType: `0x02${mintSmtEntry}`, outputType: '' },
)
return rawTx
}
2 changes: 1 addition & 1 deletion src/service/cota/transfer-update.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ export const generateTransferUpdateCotaTx = async (
witnesses: [],
}
rawTx.witnesses = rawTx.inputs.map((_, i) =>
i > 0 ? '0x' : { lock: '', inputType: `0x08${transferUpdateSmtEntry}`, outputType: '' },
i > 0 ? '' : { lock: '', inputType: `0x08${transferUpdateSmtEntry}`, outputType: '' },
)
return rawTx
}
2 changes: 1 addition & 1 deletion src/service/cota/transfer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ export const generateTransferCotaTx = async (
witnesses: [],
}
rawTx.witnesses = rawTx.inputs.map((_, i) =>
i > 0 ? '0x' : { lock: '', inputType: `0x06${transferSmtEntry}`, outputType: '' },
i > 0 ? '' : { lock: '', inputType: `0x06${transferSmtEntry}`, outputType: '' },
)
return rawTx
}
2 changes: 1 addition & 1 deletion src/service/cota/update.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export const generateUpdateCotaTx = async (
witnesses: [],
}
rawTx.witnesses = rawTx.inputs.map((_, i) =>
i > 0 ? '0x' : { lock: '', inputType: `0x05${updateSmtEntry}`, outputType: '' },
i > 0 ? '' : { lock: '', inputType: `0x05${updateSmtEntry}`, outputType: '' },
)
return rawTx
}
2 changes: 1 addition & 1 deletion src/service/cota/withdraw.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ export const generateWithdrawCotaTx = async (
witnesses: [],
}
rawTx.witnesses = rawTx.inputs.map((_, i) =>
i > 0 ? '0x' : { lock: '', inputType: `0x03${withdrawalSmtEntry}`, outputType: '' },
i > 0 ? '' : { lock: '', inputType: `0x03${withdrawalSmtEntry}`, outputType: '' },
)
return rawTx
}
2 changes: 1 addition & 1 deletion src/service/registry/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,6 @@ export const generateRegisterCotaTx = async (
}
const registryWitness = serializeWitnessArgs({ lock: '', inputType: append0x(registrySmtEntry), outputType: '' })
const emptyWitness = { lock: '', inputType: '', outputType: '' }
rawTx.witnesses = rawTx.inputs.map((_, i) => (i === 0 ? registryWitness : i === 1 ? emptyWitness : '0x'))
rawTx.witnesses = rawTx.inputs.map((_, i) => (i === 0 ? registryWitness : i === 1 ? emptyWitness : ''))
return rawTx
}

0 comments on commit 79b5bae

Please sign in to comment.