OxL Reference

method SchemaCompat.roundtrip

New writer -> old reader -> old writer -> new reader (D-7071).

Example:

oxl✓ checked in CI
data Person {
  id: i64
  name: str
}

test contract "roundtrip through the published schema" with schema(old: "published") as old {
  assert_eq(old.roundtrip(Person{ id: 2, name: "bob" }).id, 2)
}
pub(api) fn roundtrip<T: Serializable>(x: &T) -> T

Since. 1.0.0-beta

Parameters

NameType
x&T

Returns

T

Effects

none declared (pure unless the body says otherwise)

Defined in: std/core/testing.oxl:397

See also