Getting UnsupportedSysvar error trying to get a Clock instance

52 Views Asked by At

I am trying to get a Clock obj from within a rust client as below (simplified version), but I am getting the error UnsupportedSysvar. Is it possible to call this?

This is a simplified version of what I tried:

use solana_program::clock::Clock;

fn get_clock() -> Clock {
  let clock = Clock::get().unwrap();
  clock
}
0

There are 0 best solutions below