-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: contract is now upgradeable through participants voting for upd…
…ates (#714) * Moved contract various states to state.rs * Added near-rng crate * Added ability to deploy and update contract configs
- Loading branch information
1 parent
c0abf1d
commit 84ff24c
Showing
8 changed files
with
521 additions
and
83 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
use borsh::{self, BorshDeserialize, BorshSerialize}; | ||
use serde::{Deserialize, Serialize}; | ||
|
||
#[derive(Clone, Debug, Serialize, Deserialize, BorshSerialize, BorshDeserialize, PartialEq, Eq)] | ||
pub struct Config { | ||
/// Timeout for triple generation in milliseconds. | ||
pub triple_timeout: u64, | ||
/// Timeout for presignature generation in milliseconds. | ||
pub presignature_timeout: u64, | ||
/// Timeout for signature generation in milliseconds. | ||
pub signature_timeout: u64, | ||
} | ||
|
||
impl Default for Config { | ||
fn default() -> Self { | ||
Self { | ||
triple_timeout: min_to_ms(20), | ||
presignature_timeout: secs_to_ms(30), | ||
signature_timeout: secs_to_ms(30), | ||
} | ||
} | ||
} | ||
|
||
pub const fn secs_to_ms(secs: u64) -> u64 { | ||
secs * 1000 | ||
} | ||
|
||
pub const fn min_to_ms(min: u64) -> u64 { | ||
min * 60 * 1000 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.