mirror of
https://github.com/logos-blockchain/lssa.git
synced 2026-01-07 15:53:14 +00:00
add test_interpret_invalid_asset
This commit is contained in:
parent
150652c779
commit
85102cb893
@ -122,5 +122,14 @@ mod tests {
|
|||||||
assert_eq!(interpreted, TestAsset { id: 1, name: "Test".to_string() });
|
assert_eq!(interpreted, TestAsset { id: 1, name: "Test".to_string() });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn test_interpret_invalid_asset() {
|
||||||
|
let mut payload = sample_payload();
|
||||||
|
payload.asset = vec![0, 1, 2, 3]; // Invalid data for deserialization
|
||||||
|
let utxo = UTXO::create_utxo_from_payload(payload);
|
||||||
|
|
||||||
|
// This should fail because the asset is not valid JSON for TestAsset
|
||||||
|
let result: Result<TestAsset> = utxo.interpret_asset();
|
||||||
|
assert!(result.is_err());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user