Skip to content

Commit

Permalink
fix tests and comments
Browse files Browse the repository at this point in the history
  • Loading branch information
joyqvq committed Aug 18, 2023
1 parent 3852ca8 commit 2d8fa72
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion crates/sui-core/src/authority/authority_per_epoch_store.rs
Original file line number Diff line number Diff line change
Expand Up @@ -473,7 +473,7 @@ impl AuthorityPerEpochStore {
let supported_providers = protocol_config
.zklogin_supported_providers()
.iter()
.map(|a| OIDCProvider::from_str(&a).expect("Invalid provider string"))
.map(|s| OIDCProvider::from_str(s).expect("Invalid provider string"))
.collect::<Vec<_>>();

let signature_verifier = SignatureVerifier::new(
Expand Down
4 changes: 2 additions & 2 deletions crates/sui-core/src/signature_verifier.rs
Original file line number Diff line number Diff line change
Expand Up @@ -109,9 +109,9 @@ pub struct SignatureVerifier {
/// Contains two parameters to pass in to verify a ZkLogin signature.
#[derive(Clone)]
struct ZkLoginParams {
/// A list of supported providers for ZkLogin supports.
/// A list of supported OAuth providers for ZkLogin.
pub supported_providers: Vec<OIDCProvider>,
/// The environment (prod/test) the code runs in.
/// The environment (prod/test) the code runs in. It decides which verifying key to use in fastcrypto.
pub env: ZkLoginEnv,
}

Expand Down
3 changes: 2 additions & 1 deletion crates/sui-node/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ impl SuiNode {
.protocol_config()
.zklogin_supported_providers()
.iter()
.map(|s| OIDCProvider::from_str(s).unwrap())
.map(|s| OIDCProvider::from_str(s).expect("Invalid provider string"))
.collect::<Vec<_>>();
let fetch_and_sleep = async move {
// Update the JWK value in the authority server
Expand Down Expand Up @@ -263,6 +263,7 @@ impl SuiNode {
#[allow(unused_variables)]
async fn fetch_jwks(supported_providers: &[OIDCProvider]) -> SuiResult<Vec<(JwkId, JWK)>> {
use fastcrypto_zkp::bn254::zk_login::parse_jwks;
// Just load a default Twitch jwk for testing.
parse_jwks(
sui_types::zk_login_util::DEFAULT_JWK_BYTES,
&OIDCProvider::Twitch,
Expand Down
3 changes: 1 addition & 2 deletions crates/sui-open-rpc/spec/openrpc.json
Original file line number Diff line number Diff line change
Expand Up @@ -1369,8 +1369,7 @@
"simplified_unwrap_then_delete": false,
"txn_base_cost_as_multiplier": false,
"upgraded_multisig_supported": false,
"zklogin_auth": false,
"zklogin_use_secure_vk": false
"zklogin_auth": false
},
"attributes": {
"address_from_bytes_cost_base": {
Expand Down
2 changes: 1 addition & 1 deletion crates/sui-types/src/base_types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -604,7 +604,7 @@ impl From<&MultiSigPublicKey> for SuiAddress {
}

/// Sui address for [struct ZkLoginAuthenticator] is defined as the black2b hash of
/// [zklogin_flag || bcs bytes of AddressParams || address seed in bytes] where
/// [zklogin_flag || bcs bytes of AddressParams || address_seed in bytes] where
/// AddressParams contains iss and aud string.
impl From<&ZkLoginAuthenticator> for SuiAddress {
fn from(authenticator: &ZkLoginAuthenticator) -> Self {
Expand Down

0 comments on commit 2d8fa72

Please sign in to comment.