wallet-core: remove allowed auditors from contract terms

This commit is contained in:
Florian Dold 2023-05-05 13:29:49 +02:00
parent 60805f3ff8
commit cbf0f83954
No known key found for this signature in database
GPG Key ID: D2E4F00F29D02A4B
6 changed files with 5 additions and 39 deletions

View File

@ -448,11 +448,6 @@ export interface MerchantContractTerms {
*/
amount: string;
/**
* Auditors accepted by the merchant.
*/
auditors: AuditorHandle[];
/**
* Deadline to pay for the contract.
*/
@ -1321,7 +1316,6 @@ export const codecForMerchantContractTerms = (): Codec<MerchantContractTerms> =>
.property("summary_i18n", codecOptional(codecForInternationalizedString()))
.property("nonce", codecForString())
.property("amount", codecForString())
.property("auditors", codecForList(codecForAuditorHandle()))
.property("pay_deadline", codecForTimestamp)
.property("refund_deadline", codecForTimestamp)
.property("wire_transfer_deadline", codecForTimestamp)

View File

@ -1120,7 +1120,6 @@ export interface WalletContractData {
wireFeeAmortization: number;
payDeadline: TalerProtocolTimestamp;
refundDeadline: TalerProtocolTimestamp;
allowedAuditors: AllowedAuditorInfo[];
allowedExchanges: AllowedExchangeInfo[];
timestamp: TalerProtocolTimestamp;
wireMethod: string;

View File

@ -910,7 +910,6 @@ export async function prepareDepositGroup(
const now = AbsoluteTime.now();
const nowRounded = AbsoluteTime.toTimestamp(now);
const contractTerms: MerchantContractTerms = {
auditors: [],
exchanges: exchangeInfos,
amount: req.amount,
max_fee: Amounts.stringify(amount),
@ -944,7 +943,7 @@ export async function prepareDepositGroup(
);
const payCoinSel = await selectPayCoinsNew(ws, {
auditors: contractData.allowedAuditors,
auditors: [],
exchanges: contractData.allowedExchanges,
wireMethod: contractData.wireMethod,
contractTermsAmount: Amounts.parseOrThrow(contractData.amount),
@ -1029,7 +1028,6 @@ export async function createDepositGroup(
const wireSalt = encodeCrock(getRandomBytes(16));
const wireHash = hashWire(req.depositPaytoUri, wireSalt);
const contractTerms: MerchantContractTerms = {
auditors: [],
exchanges: exchangeInfos,
amount: req.amount,
max_fee: Amounts.stringify(amount),
@ -1063,7 +1061,7 @@ export async function createDepositGroup(
);
const payCoinSel = await selectPayCoinsNew(ws, {
auditors: contractData.allowedAuditors,
auditors: [],
exchanges: contractData.allowedExchanges,
wireMethod: contractData.wireMethod,
contractTermsAmount: Amounts.parseOrThrow(contractData.amount),

View File

@ -286,10 +286,6 @@ export function extractContractData(
payDeadline: parsedContractTerms.pay_deadline,
refundDeadline: parsedContractTerms.refund_deadline,
wireFeeAmortization: parsedContractTerms.wire_fee_amortization || 1,
allowedAuditors: parsedContractTerms.auditors.map((x) => ({
auditorBaseUrl: x.url,
auditorPub: x.auditor_pub,
})),
allowedExchanges: parsedContractTerms.exchanges.map((x) => ({
exchangeBaseUrl: x.url,
exchangePub: x.master_pub,
@ -798,7 +794,7 @@ async function handleInsufficientFunds(
});
const res = await selectPayCoinsNew(ws, {
auditors: contractData.allowedAuditors,
auditors: [],
exchanges: contractData.allowedExchanges,
wireMethod: contractData.wireMethod,
contractTermsAmount: Amounts.parseOrThrow(contractData.amount),
@ -921,7 +917,7 @@ export async function checkPaymentByProposalId(
if (!purchase || purchase.purchaseStatus === PurchaseStatus.Proposed) {
// If not already paid, check if we could pay for it.
const res = await selectPayCoinsNew(ws, {
auditors: contractData.allowedAuditors,
auditors: [],
exchanges: contractData.allowedExchanges,
contractTermsAmount: Amounts.parseOrThrow(contractData.amount),
depositFeeLimit: Amounts.parseOrThrow(contractData.maxDepositFee),
@ -1266,7 +1262,7 @@ export async function confirmPay(
const contractData = d.contractData;
const selectCoinsResult = await selectPayCoinsNew(ws, {
auditors: contractData.allowedAuditors,
auditors: [],
exchanges: contractData.allowedExchanges,
wireMethod: contractData.wireMethod,
contractTermsAmount: Amounts.parseOrThrow(contractData.amount),

View File

@ -51,12 +51,6 @@ const cd: WalletContractData = {
t_s: 1660002673,
},
wireFeeAmortization: 1,
allowedAuditors: [
{
auditorBaseUrl: "https://auditor.taler.ar/",
auditorPub: "0000000000000000000000000000000000000000000000000000",
},
],
allowedExchanges: [
{
exchangeBaseUrl: "https://exchange.taler.ar/",

View File

@ -407,21 +407,6 @@ export function ShowView({ contractTerms, hideHandler }: States.Show): VNode {
</td>
<td>{contractTerms.wireFeeAmortization}</td>
</tr>
<tr>
<td>
<i18n.Translate>Auditors</i18n.Translate>
</td>
<td>
{(contractTerms.allowedAuditors || []).map((e) => (
<Fragment key={e.auditorPub}>
<a href={e.auditorBaseUrl} title={e.auditorPub}>
{e.auditorPub.substring(0, 6)}...
</a>
&nbsp;
</Fragment>
))}
</td>
</tr>
<tr>
<td>
<i18n.Translate>Exchanges</i18n.Translate>