wallet-core: remove allowed auditors from contract terms
This commit is contained in:
parent
60805f3ff8
commit
cbf0f83954
@ -448,11 +448,6 @@ export interface MerchantContractTerms {
|
|||||||
*/
|
*/
|
||||||
amount: string;
|
amount: string;
|
||||||
|
|
||||||
/**
|
|
||||||
* Auditors accepted by the merchant.
|
|
||||||
*/
|
|
||||||
auditors: AuditorHandle[];
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Deadline to pay for the contract.
|
* Deadline to pay for the contract.
|
||||||
*/
|
*/
|
||||||
@ -1321,7 +1316,6 @@ export const codecForMerchantContractTerms = (): Codec<MerchantContractTerms> =>
|
|||||||
.property("summary_i18n", codecOptional(codecForInternationalizedString()))
|
.property("summary_i18n", codecOptional(codecForInternationalizedString()))
|
||||||
.property("nonce", codecForString())
|
.property("nonce", codecForString())
|
||||||
.property("amount", codecForString())
|
.property("amount", codecForString())
|
||||||
.property("auditors", codecForList(codecForAuditorHandle()))
|
|
||||||
.property("pay_deadline", codecForTimestamp)
|
.property("pay_deadline", codecForTimestamp)
|
||||||
.property("refund_deadline", codecForTimestamp)
|
.property("refund_deadline", codecForTimestamp)
|
||||||
.property("wire_transfer_deadline", codecForTimestamp)
|
.property("wire_transfer_deadline", codecForTimestamp)
|
||||||
|
@ -1120,7 +1120,6 @@ export interface WalletContractData {
|
|||||||
wireFeeAmortization: number;
|
wireFeeAmortization: number;
|
||||||
payDeadline: TalerProtocolTimestamp;
|
payDeadline: TalerProtocolTimestamp;
|
||||||
refundDeadline: TalerProtocolTimestamp;
|
refundDeadline: TalerProtocolTimestamp;
|
||||||
allowedAuditors: AllowedAuditorInfo[];
|
|
||||||
allowedExchanges: AllowedExchangeInfo[];
|
allowedExchanges: AllowedExchangeInfo[];
|
||||||
timestamp: TalerProtocolTimestamp;
|
timestamp: TalerProtocolTimestamp;
|
||||||
wireMethod: string;
|
wireMethod: string;
|
||||||
|
@ -910,7 +910,6 @@ export async function prepareDepositGroup(
|
|||||||
const now = AbsoluteTime.now();
|
const now = AbsoluteTime.now();
|
||||||
const nowRounded = AbsoluteTime.toTimestamp(now);
|
const nowRounded = AbsoluteTime.toTimestamp(now);
|
||||||
const contractTerms: MerchantContractTerms = {
|
const contractTerms: MerchantContractTerms = {
|
||||||
auditors: [],
|
|
||||||
exchanges: exchangeInfos,
|
exchanges: exchangeInfos,
|
||||||
amount: req.amount,
|
amount: req.amount,
|
||||||
max_fee: Amounts.stringify(amount),
|
max_fee: Amounts.stringify(amount),
|
||||||
@ -944,7 +943,7 @@ export async function prepareDepositGroup(
|
|||||||
);
|
);
|
||||||
|
|
||||||
const payCoinSel = await selectPayCoinsNew(ws, {
|
const payCoinSel = await selectPayCoinsNew(ws, {
|
||||||
auditors: contractData.allowedAuditors,
|
auditors: [],
|
||||||
exchanges: contractData.allowedExchanges,
|
exchanges: contractData.allowedExchanges,
|
||||||
wireMethod: contractData.wireMethod,
|
wireMethod: contractData.wireMethod,
|
||||||
contractTermsAmount: Amounts.parseOrThrow(contractData.amount),
|
contractTermsAmount: Amounts.parseOrThrow(contractData.amount),
|
||||||
@ -1029,7 +1028,6 @@ export async function createDepositGroup(
|
|||||||
const wireSalt = encodeCrock(getRandomBytes(16));
|
const wireSalt = encodeCrock(getRandomBytes(16));
|
||||||
const wireHash = hashWire(req.depositPaytoUri, wireSalt);
|
const wireHash = hashWire(req.depositPaytoUri, wireSalt);
|
||||||
const contractTerms: MerchantContractTerms = {
|
const contractTerms: MerchantContractTerms = {
|
||||||
auditors: [],
|
|
||||||
exchanges: exchangeInfos,
|
exchanges: exchangeInfos,
|
||||||
amount: req.amount,
|
amount: req.amount,
|
||||||
max_fee: Amounts.stringify(amount),
|
max_fee: Amounts.stringify(amount),
|
||||||
@ -1063,7 +1061,7 @@ export async function createDepositGroup(
|
|||||||
);
|
);
|
||||||
|
|
||||||
const payCoinSel = await selectPayCoinsNew(ws, {
|
const payCoinSel = await selectPayCoinsNew(ws, {
|
||||||
auditors: contractData.allowedAuditors,
|
auditors: [],
|
||||||
exchanges: contractData.allowedExchanges,
|
exchanges: contractData.allowedExchanges,
|
||||||
wireMethod: contractData.wireMethod,
|
wireMethod: contractData.wireMethod,
|
||||||
contractTermsAmount: Amounts.parseOrThrow(contractData.amount),
|
contractTermsAmount: Amounts.parseOrThrow(contractData.amount),
|
||||||
|
@ -286,10 +286,6 @@ export function extractContractData(
|
|||||||
payDeadline: parsedContractTerms.pay_deadline,
|
payDeadline: parsedContractTerms.pay_deadline,
|
||||||
refundDeadline: parsedContractTerms.refund_deadline,
|
refundDeadline: parsedContractTerms.refund_deadline,
|
||||||
wireFeeAmortization: parsedContractTerms.wire_fee_amortization || 1,
|
wireFeeAmortization: parsedContractTerms.wire_fee_amortization || 1,
|
||||||
allowedAuditors: parsedContractTerms.auditors.map((x) => ({
|
|
||||||
auditorBaseUrl: x.url,
|
|
||||||
auditorPub: x.auditor_pub,
|
|
||||||
})),
|
|
||||||
allowedExchanges: parsedContractTerms.exchanges.map((x) => ({
|
allowedExchanges: parsedContractTerms.exchanges.map((x) => ({
|
||||||
exchangeBaseUrl: x.url,
|
exchangeBaseUrl: x.url,
|
||||||
exchangePub: x.master_pub,
|
exchangePub: x.master_pub,
|
||||||
@ -798,7 +794,7 @@ async function handleInsufficientFunds(
|
|||||||
});
|
});
|
||||||
|
|
||||||
const res = await selectPayCoinsNew(ws, {
|
const res = await selectPayCoinsNew(ws, {
|
||||||
auditors: contractData.allowedAuditors,
|
auditors: [],
|
||||||
exchanges: contractData.allowedExchanges,
|
exchanges: contractData.allowedExchanges,
|
||||||
wireMethod: contractData.wireMethod,
|
wireMethod: contractData.wireMethod,
|
||||||
contractTermsAmount: Amounts.parseOrThrow(contractData.amount),
|
contractTermsAmount: Amounts.parseOrThrow(contractData.amount),
|
||||||
@ -921,7 +917,7 @@ export async function checkPaymentByProposalId(
|
|||||||
if (!purchase || purchase.purchaseStatus === PurchaseStatus.Proposed) {
|
if (!purchase || purchase.purchaseStatus === PurchaseStatus.Proposed) {
|
||||||
// If not already paid, check if we could pay for it.
|
// If not already paid, check if we could pay for it.
|
||||||
const res = await selectPayCoinsNew(ws, {
|
const res = await selectPayCoinsNew(ws, {
|
||||||
auditors: contractData.allowedAuditors,
|
auditors: [],
|
||||||
exchanges: contractData.allowedExchanges,
|
exchanges: contractData.allowedExchanges,
|
||||||
contractTermsAmount: Amounts.parseOrThrow(contractData.amount),
|
contractTermsAmount: Amounts.parseOrThrow(contractData.amount),
|
||||||
depositFeeLimit: Amounts.parseOrThrow(contractData.maxDepositFee),
|
depositFeeLimit: Amounts.parseOrThrow(contractData.maxDepositFee),
|
||||||
@ -1266,7 +1262,7 @@ export async function confirmPay(
|
|||||||
const contractData = d.contractData;
|
const contractData = d.contractData;
|
||||||
|
|
||||||
const selectCoinsResult = await selectPayCoinsNew(ws, {
|
const selectCoinsResult = await selectPayCoinsNew(ws, {
|
||||||
auditors: contractData.allowedAuditors,
|
auditors: [],
|
||||||
exchanges: contractData.allowedExchanges,
|
exchanges: contractData.allowedExchanges,
|
||||||
wireMethod: contractData.wireMethod,
|
wireMethod: contractData.wireMethod,
|
||||||
contractTermsAmount: Amounts.parseOrThrow(contractData.amount),
|
contractTermsAmount: Amounts.parseOrThrow(contractData.amount),
|
||||||
|
@ -51,12 +51,6 @@ const cd: WalletContractData = {
|
|||||||
t_s: 1660002673,
|
t_s: 1660002673,
|
||||||
},
|
},
|
||||||
wireFeeAmortization: 1,
|
wireFeeAmortization: 1,
|
||||||
allowedAuditors: [
|
|
||||||
{
|
|
||||||
auditorBaseUrl: "https://auditor.taler.ar/",
|
|
||||||
auditorPub: "0000000000000000000000000000000000000000000000000000",
|
|
||||||
},
|
|
||||||
],
|
|
||||||
allowedExchanges: [
|
allowedExchanges: [
|
||||||
{
|
{
|
||||||
exchangeBaseUrl: "https://exchange.taler.ar/",
|
exchangeBaseUrl: "https://exchange.taler.ar/",
|
||||||
|
@ -407,21 +407,6 @@ export function ShowView({ contractTerms, hideHandler }: States.Show): VNode {
|
|||||||
</td>
|
</td>
|
||||||
<td>{contractTerms.wireFeeAmortization}</td>
|
<td>{contractTerms.wireFeeAmortization}</td>
|
||||||
</tr>
|
</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>
|
|
||||||
|
|
||||||
</Fragment>
|
|
||||||
))}
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
<tr>
|
||||||
<td>
|
<td>
|
||||||
<i18n.Translate>Exchanges</i18n.Translate>
|
<i18n.Translate>Exchanges</i18n.Translate>
|
||||||
|
Loading…
Reference in New Issue
Block a user