Skip to content

Commit

Permalink
fix: large enum warning
Browse files Browse the repository at this point in the history
  • Loading branch information
8e8b2c committed May 20, 2024
1 parent 26aa40f commit decc5a1
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ async fn checks_validity_of_solana_wallet_attestation() {
let solana_signature = signing_key.try_sign(message.as_bytes()).unwrap();

let chain_wallet_signature = ChainWalletSignature::Solana {
solana_address,
solana_address: Box::new(solana_address),
solana_signature,
};

Expand All @@ -130,7 +130,7 @@ async fn checks_validity_of_solana_wallet_attestation() {

let malicious_attestation = WalletAttestation {
chain_wallet_signature: ChainWalletSignature::Solana {
solana_address,
solana_address: Box::new(solana_address),
solana_signature,
},
agent: setup.alice_pubkey(),
Expand Down
2 changes: 1 addition & 1 deletion crates/holoom_rocket_controllers/src/username_registry.rs
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ pub async fn wallets(
.collect();

let solana_addresses = wallet_attestations
.iter()
.into_iter()
.filter_map(|wa| match wa.chain_wallet_signature {
ChainWalletSignature::Solana { solana_address, .. } => {
Some(bs58::encode(solana_address.as_bytes()).into_string())
Expand Down
2 changes: 1 addition & 1 deletion crates/holoom_types/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ pub enum ChainWalletSignature {
evm_signature: EvmSignature,
},
Solana {
solana_address: SolanaAddress,
solana_address: Box<SolanaAddress>,
solana_signature: SolanaSignature,
},
}
Expand Down
6 changes: 3 additions & 3 deletions crates/username_registry_validation/src/wallet_attestation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,11 @@ fn verify_evm_signature(

fn verify_solana_signature(
solana_signature: SolanaSignature,
solana_address: SolanaAddress,
solana_address: &SolanaAddress,
agent: AgentPubKey,
prev_action: ActionHash,
) -> ExternResult<ValidateCallbackResult> {
let message = solana_signing_message(&solana_address, agent, prev_action);
let message = solana_signing_message(solana_address, agent, prev_action);
match solana_address.verify_strict(message.as_bytes(), &solana_signature) {
Ok(()) => Ok(ValidateCallbackResult::Valid),
Err(_) => Ok(ValidateCallbackResult::Invalid(
Expand Down Expand Up @@ -101,7 +101,7 @@ pub fn validate_create_wallet_attestation(
solana_signature,
} => verify_solana_signature(
solana_signature,
solana_address,
&solana_address,
wallet_attestation.agent,
wallet_attestation.prev_action,
),
Expand Down

0 comments on commit decc5a1

Please sign in to comment.