fix(wallet-buy-nym): signature output
This commit is contained in:
@@ -13,7 +13,7 @@ use serde_json::json;
|
||||
pub struct SignatureOutputJson {
|
||||
pub account_id: String,
|
||||
pub public_key: PublicKey,
|
||||
pub signature: String,
|
||||
pub signature_as_hex: String,
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
@@ -32,14 +32,14 @@ pub async fn sign(
|
||||
|
||||
log::info!("<<< Signing message");
|
||||
let signature = wallet.sign_raw_with_account(account, message.as_bytes())?;
|
||||
let signature_as_hex_string = signature.to_string();
|
||||
let output = SignatureOutputJson {
|
||||
account_id: account.address().to_string(),
|
||||
public_key: account.public_key(),
|
||||
signature: signature_as_hex_string.to_string(),
|
||||
signature_as_hex: signature.to_string(),
|
||||
};
|
||||
log::info!(">>> Signing data {}", json!(output),);
|
||||
Ok(signature_as_hex_string)
|
||||
let output_json = json!(output).to_string();
|
||||
log::info!(">>> Signing data {}", output_json);
|
||||
Ok(output_json)
|
||||
}
|
||||
|
||||
async fn get_pubkey_from_account_address(
|
||||
|
||||
@@ -26,13 +26,15 @@ export const SignMessageModal = ({ onClose }: { onClose: () => void }) => {
|
||||
};
|
||||
|
||||
if (error) {
|
||||
<ErrorModal
|
||||
open
|
||||
message={`An error occured: ${error}`}
|
||||
onClose={() => {
|
||||
refresh();
|
||||
}}
|
||||
/>;
|
||||
return (
|
||||
<ErrorModal
|
||||
open
|
||||
message={`An error occured: ${error}`}
|
||||
onClose={() => {
|
||||
refresh();
|
||||
}}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
return (
|
||||
@@ -69,7 +71,7 @@ export const SignMessageModal = ({ onClose }: { onClose: () => void }) => {
|
||||
<Typography variant="body2" component="span" fontWeight={400} sx={{ mr: 1, color: 'text.primary' }}>
|
||||
Copy signature
|
||||
</Typography>
|
||||
<CopyToClipboard text={signature} />
|
||||
<CopyToClipboard text={signature} iconButton />
|
||||
</Stack>
|
||||
</Stack>
|
||||
</SimpleModal>
|
||||
|
||||
@@ -107,7 +107,7 @@ export const Tutorial = () => {
|
||||
/>
|
||||
</Grid>
|
||||
<Stack direction="row" gap={2} justifyContent="flex-end" mt={5}>
|
||||
<Button variant="outlined" size="large" onClick={() => {}}>
|
||||
<Button variant="outlined" size="large" onClick={() => setShowSignModal(true)}>
|
||||
Sign message
|
||||
</Button>
|
||||
<Button variant="contained" size="large" onClick={() => {}}>
|
||||
|
||||
Reference in New Issue
Block a user