pub fn change_release_time(&mut self, ctx: &Context, new_time: u64) -> Result<()> {
        // If the caller is not the message author,
        // They get an error.
        if !(&self.author == &ctx.sender()) {
            return Err("Sender does not have permission to make message public.".to_string());
        }
        // If the caller IS not the message author,
        // but the message has already been released,
        // They get an error.
        //
        // This prevents authors from getting a false sense of security
        // By making confidential an already-released message.
        else if now() > self.message_release_time {
            return Err("Cannot update release time of already-released message.".to_string());
        }
        self.message_release_time = new_time;
        Ok(())
    }
/// Leak the message at some different time. Only the message's author can do this.
Leak the message at some different time. Only the message's author can do this.
Leak the message at some different time . Only the message ' s author can do this .
pub fn change_release_time(&mut self, ctx: &Context, new_time: u64) -> Result<()> {
        // If the caller is not the message author,
        // They get an error.
        if !(&self.author == &ctx.sender()) {
            return Err("Sender does not have permission to make message public.".to_string());
        }
        // If the caller IS not the message author,
        // but the message has already been released,
        // They get an error.
        //
        // This prevents authors from getting a false sense of security
        // By making confidential an already-released message.
        else if now() > self.message_release_time {
            return Err("Cannot update release time of already-released message.".to_string());
        }
        self.message_release_time = new_time;
        Ok(())
    }
pub fn change_release_time ( & mut self , ctx : & Context , new_time : u64 ) -> Result < ( ) > { // If the caller is not the message author, // They get an error. if ! ( & self . author == & ctx . sender ( ) ) { return Err ( " " . to_string ( ) ) ; } // If the caller IS not the message author, // but the message has already been released, // They get an error. // // This prevents authors from getting a false sense of security // By making confidential an already-released message. else if now ( ) > self . message_release_time { return Err ( " " . to_string ( ) ) ; } self . message_release_time = new_time ; Ok ( ( ) ) }
Leak the message at some different time.
Leak the message at some different time .
&mut self
ctx
&Context
new_time
u64