RGB-WG / rgb-core

RGB Core Library: consensus validation for private & scalable client-validated smart contracts on Bitcoin & Lightning
https://spec.rgb.tech
Apache License 2.0
207 stars 52 forks source link

Add fast-forward version value to operations #150

Closed dr-orlovsky closed 1 year ago

dr-orlovsky commented 1 year ago

This should enable future fast-forward updates.

Currently version must be enforced at the type level, i.e. like

struct Transition<const VERSION: u8 = 0> {
   version: Ffv,
}

impl<const VERSION: u8> StrictDecode for Transition {
  fn strict_check(&self) -> Result<(), DecodeError> {
    if self.version != Ffv::V0 {
      return ....
    }
  }
}
dr-orlovsky commented 1 year ago

Closed with #151