fix signature for aml decision

This commit is contained in:
Sebastian 2023-08-04 09:09:00 -03:00
parent c12a366d49
commit 6f4548c892
No known key found for this signature in database
GPG Key ID: 173909D1A5F66069
3 changed files with 7 additions and 5 deletions

View File

@ -61,17 +61,20 @@ export function buildQuerySignature(key: SigningKey): string {
return encodeCrock(eddsaSign(sigBlob, key)); return encodeCrock(eddsaSign(sigBlob, key));
} }
export function buildDecisionSignature( export function buildDecisionSignature(
key: SigningKey, key: SigningKey,
decision: AmlExchangeBackend.AmlDecision, decision: AmlExchangeBackend.AmlDecision,
): string { ): string {
const zero = new Uint8Array(new ArrayBuffer(64))
const sigBlob = buildSigPS(TalerSignaturePurpose.TALER_SIGNATURE_AML_DECISION) const sigBlob = buildSigPS(TalerSignaturePurpose.TALER_SIGNATURE_AML_DECISION)
.put(hash(stringToBytes(decision.justification))) //TODO: new need the null terminator, also in the exchange
// .put(timestampRoundedToBuffer(decision.decision_time)) .put(hash(stringToBytes(decision.justification)))//check null
.put(timestampRoundedToBuffer(decision.decision_time))
.put(amountToBuffer(decision.new_threshold)) .put(amountToBuffer(decision.new_threshold))
.put(decodeCrock(decision.h_payto)) .put(decodeCrock(decision.h_payto))
// .put(hash(stringToBytes(decision.kyc_requirements))) .put(zero) //kyc_requirement
.put(bufferForUint32(decision.new_state)) .put(bufferForUint32(decision.new_state))
.build(); .build();

View File

@ -85,7 +85,6 @@ export function useCases(
const records = !afterData const records = !afterData
? [] ? []
: ((afterData ?? lastAfter).data ?? { records: [] }).records; : ((afterData ?? lastAfter).data ?? { records: [] }).records;
console.log("afterdata", afterData, lastAfter, records)
if (loadingAfter) return { loading: true, data: { records } }; if (loadingAfter) return { loading: true, data: { records } };
if (afterData) { if (afterData) {
return { ok: true, data: { records }, ...pagination }; return { ok: true, data: { records }, ...pagination };

View File

@ -38,7 +38,7 @@ export function NewFormEntry({
fullName: "loggedIn_user_fullname", fullName: "loggedIn_user_fullname",
when: AbsoluteTime.now(), when: AbsoluteTime.now(),
state: AmlExchangeBackend.AmlState.pending, state: AmlExchangeBackend.AmlState.pending,
threshold: Amounts.parseOrThrow("ARS:1000"), threshold: Amounts.parseOrThrow("KUDOS:1000"),
}; };
const api = useAmlCasesAPI() const api = useAmlCasesAPI()