mirror of
https://github.com/jwinterm/grin-wallet.git
synced 2026-10-17 07:11:36 +02:00
keep old payment proofs readable
This commit is contained in:
+20
-1
@@ -791,7 +791,7 @@ pub struct StoredProofInfo {
|
||||
/// Optional payment memo
|
||||
pub memo: Option<PaymentMemo>,
|
||||
/// recipient promise signature
|
||||
#[serde(with = "dalek_ser::option_dalek_sig_serde")]
|
||||
#[serde(default, with = "dalek_ser::option_dalek_sig_serde")]
|
||||
pub promise_signature: Option<DalekSignature>,
|
||||
/// Original Sender partial key
|
||||
pub sender_part_sig: Option<Signature>,
|
||||
@@ -1005,6 +1005,7 @@ pub mod option_duration_as_secs {
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
use ed25519_dalek::SigningKey as DalekSecretKey;
|
||||
use grin_core::ser::{DeserializationMode, ProtocolVersion, Readable, Reader, StreamingReader};
|
||||
use grin_keychain::{ExtKeychain, ExtKeychainPath};
|
||||
use serde_json::Value;
|
||||
@@ -1049,6 +1050,24 @@ mod tests {
|
||||
assert_eq!(none, none2);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn reads_old_payment_proof() {
|
||||
let address = DalekSecretKey::from_bytes(&[1; 32])
|
||||
.verifying_key()
|
||||
.to_bytes()
|
||||
.to_hex();
|
||||
let proof = serde_json::json!({
|
||||
"receiver_address": address,
|
||||
"receiver_signature": null,
|
||||
"sender_address_path": 0,
|
||||
"sender_address": address,
|
||||
"sender_signature": null
|
||||
});
|
||||
|
||||
let proof: StoredProofInfo = serde_json::from_value(proof).unwrap();
|
||||
assert!(proof.promise_signature.is_none());
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn big_context_read() {
|
||||
let protocol_ver = ProtocolVersion(3);
|
||||
|
||||
Reference in New Issue
Block a user