From cfa1df734315efc8e24a1a846e4d694abe2249ea Mon Sep 17 00:00:00 2001 From: Florian Dold Date: Wed, 26 Jun 2019 15:30:32 +0200 Subject: add link signature to /refresh/reveal --- src/crypto/emscInterface.ts | 32 +++++++++++++++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) (limited to 'src/crypto/emscInterface.ts') diff --git a/src/crypto/emscInterface.ts b/src/crypto/emscInterface.ts index dcd16e633..2ddc15a37 100644 --- a/src/crypto/emscInterface.ts +++ b/src/crypto/emscInterface.ts @@ -223,6 +223,7 @@ export enum SignaturePurpose { MERCHANT_PAYMENT_OK = 1104, MASTER_WIRE_FEES = 1028, WALLET_COIN_PAYBACK = 1203, + WALLET_COIN_LINK = 1204, } @@ -970,7 +971,7 @@ abstract class SignatureStruct { throw Error(`Key ${name} not found`); } if (!(value instanceof typemap[name])) { - throw Error("Wrong type for ${name}"); + throw Error(`Wrong type for ${name}`); } this.members[name] = value; } @@ -1293,6 +1294,35 @@ export class DepositRequestPS extends SignatureStruct { } } + +interface CoinLinkSignaturePS_args { + h_denom_pub: HashCode; + old_coin_pub: EddsaPublicKey; + transfer_pub: EcdhePublicKey; + coin_envelope_hash: HashCode; +} + + +export class CoinLinkSignaturePS extends SignatureStruct { + constructor(w: CoinLinkSignaturePS_args) { + super(w); + } + + purpose() { + return SignaturePurpose.WALLET_COIN_LINK; + } + + fieldTypes() { + return [ + ["h_denom_pub", HashCode], + ["old_coin_pub", EddsaPublicKey], + ["transfer_pub", EcdhePublicKey], + ["coin_envelope_hash", HashCode], + ]; + } +} + + /** * Arguments for constuctor of [[DenominationKeyValidityPS]]. */ -- cgit v1.2.3