ckb_ssri_std/utils/
mod.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
use ckb_std::debug;
use syscalls::vm_version;

use crate::SSRIError;

pub mod syscalls;
pub mod high_level;

pub fn should_fallback() -> Result<bool, SSRIError> {
  if ckb_std::env::argv().is_empty() {
      debug!("Should fallback!");
      return Ok(true);
  } else {
      if vm_version() != u64::MAX {
          return Err(SSRIError::InvalidVmVersion);
      } else {
          debug!("Should not fallback!");
          return Ok(false);
      }
  }
}