add new fields to signatures

This commit is contained in:
Florian Dold 2020-07-20 16:32:45 +05:30
parent b18e70c393
commit 5a8931d903
No known key found for this signature in database
GPG Key ID: D2E4F00F29D02A4B

View File

@ -72,7 +72,7 @@ import {
} from "../../util/time"; } from "../../util/time";
enum SignaturePurpose { enum SignaturePurpose {
RESERVE_WITHDRAW = 1200, WALLET_RESERVE_WITHDRAW = 1200,
WALLET_COIN_DEPOSIT = 1201, WALLET_COIN_DEPOSIT = 1201,
MASTER_DENOMINATION_KEY_VALIDITY = 1025, MASTER_DENOMINATION_KEY_VALIDITY = 1025,
MASTER_WIRE_FEES = 1028, MASTER_WIRE_FEES = 1028,
@ -160,10 +160,9 @@ export class CryptoImplementation {
const denomPubHash = hash(denomPub); const denomPubHash = hash(denomPub);
const evHash = hash(ev); const evHash = hash(ev);
const withdrawRequest = buildSigPS(SignaturePurpose.RESERVE_WITHDRAW) const withdrawRequest = buildSigPS(SignaturePurpose.WALLET_RESERVE_WITHDRAW)
.put(reservePub) .put(reservePub)
.put(amountToBuffer(amountWithFee)) .put(amountToBuffer(amountWithFee))
.put(amountToBuffer(req.feeWithdraw))
.put(denomPubHash) .put(denomPubHash)
.put(evHash) .put(evHash)
.build(); .build();
@ -337,6 +336,7 @@ export class CryptoImplementation {
const d = buildSigPS(SignaturePurpose.WALLET_COIN_DEPOSIT) const d = buildSigPS(SignaturePurpose.WALLET_COIN_DEPOSIT)
.put(decodeCrock(depositInfo.contractTermsHash)) .put(decodeCrock(depositInfo.contractTermsHash))
.put(decodeCrock(depositInfo.wireInfoHash)) .put(decodeCrock(depositInfo.wireInfoHash))
.put(hash(decodeCrock(depositInfo.denomPub)))
.put(timestampRoundedToBuffer(depositInfo.timestamp)) .put(timestampRoundedToBuffer(depositInfo.timestamp))
.put(timestampRoundedToBuffer(depositInfo.refundDeadline)) .put(timestampRoundedToBuffer(depositInfo.refundDeadline))
.put(amountToBuffer(depositInfo.spendAmount)) .put(amountToBuffer(depositInfo.spendAmount))
@ -441,6 +441,7 @@ export class CryptoImplementation {
const confirmData = buildSigPS(SignaturePurpose.WALLET_COIN_MELT) const confirmData = buildSigPS(SignaturePurpose.WALLET_COIN_MELT)
.put(sessionHash) .put(sessionHash)
.put(decodeCrock(meltCoin.denomPubHash))
.put(amountToBuffer(valueWithFee)) .put(amountToBuffer(valueWithFee))
.put(amountToBuffer(meltFee)) .put(amountToBuffer(meltFee))
.put(decodeCrock(meltCoin.coinPub)) .put(decodeCrock(meltCoin.coinPub))