mirror of
https://github.com/serai-dex/serai.git
synced 2025-12-13 22:49:25 +00:00
Merge branch 'next' into next-polkadot-sdk
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
use std::collections::HashMap;
|
||||
|
||||
use ciphersuite::Ciphersuite;
|
||||
use ciphersuite::*;
|
||||
use dalek_ff_group::Ed25519;
|
||||
|
||||
use monero_wallet::{
|
||||
@@ -32,7 +32,7 @@ pub(crate) struct Block(pub(crate) MScannableBlock);
|
||||
impl primitives::Block for Block {
|
||||
type Header = BlockHeader;
|
||||
|
||||
type Key = <Ed25519 as Ciphersuite>::G;
|
||||
type Key = <Ed25519 as WrappedGroup>::G;
|
||||
type Address = Address;
|
||||
type Output = Output;
|
||||
type Eventuality = Eventuality;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
use zeroize::Zeroizing;
|
||||
|
||||
use ciphersuite::Ciphersuite;
|
||||
use ciphersuite::*;
|
||||
use dalek_ff_group::Ed25519;
|
||||
|
||||
use monero_wallet::{address::SubaddressIndex, ViewPairError, GuaranteedViewPair};
|
||||
@@ -28,8 +28,8 @@ pub(crate) const FORWARDED_SUBADDRESS: SubaddressIndex = match SubaddressIndex::
|
||||
None => panic!("SubaddressIndex for FORWARDED_SUBADDRESS was None"),
|
||||
};
|
||||
|
||||
pub(crate) fn view_pair(key: <Ed25519 as Ciphersuite>::G) -> GuaranteedViewPair {
|
||||
match GuaranteedViewPair::new(key.0, Zeroizing::new(*view_key::<Ed25519>(0))) {
|
||||
pub(crate) fn view_pair(key: <Ed25519 as WrappedGroup>::G) -> GuaranteedViewPair {
|
||||
match GuaranteedViewPair::new(key.0, Zeroizing::new(view_key::<Ed25519>(0))) {
|
||||
Ok(view_pair) => view_pair,
|
||||
Err(ViewPairError::TorsionedSpendKey) => {
|
||||
unreachable!("dalek_ff_group::EdwardsPoint had torsion")
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
use std::io;
|
||||
|
||||
use ciphersuite::{group::Group, Ciphersuite};
|
||||
use ciphersuite::WrappedGroup;
|
||||
use dalek_ff_group::Ed25519;
|
||||
|
||||
use monero_wallet::WalletOutput;
|
||||
@@ -34,7 +34,7 @@ impl AsMut<[u8]> for OutputId {
|
||||
|
||||
#[derive(Clone, PartialEq, Eq, Debug)]
|
||||
pub(crate) struct Output(pub(crate) WalletOutput);
|
||||
impl ReceivedOutput<<Ed25519 as Ciphersuite>::G, Address> for Output {
|
||||
impl ReceivedOutput<<Ed25519 as WrappedGroup>::G, Address> for Output {
|
||||
type Id = OutputId;
|
||||
type TransactionId = [u8; 32];
|
||||
|
||||
@@ -63,12 +63,12 @@ impl ReceivedOutput<<Ed25519 as Ciphersuite>::G, Address> for Output {
|
||||
self.0.transaction()
|
||||
}
|
||||
|
||||
fn key(&self) -> <Ed25519 as Ciphersuite>::G {
|
||||
fn key(&self) -> <Ed25519 as WrappedGroup>::G {
|
||||
// The spend key will be a key we generated, so it'll be in the prime-order subgroup
|
||||
// The output's key is the spend key + (key_offset * G), so it's in the prime-order subgroup if
|
||||
// the spend key is
|
||||
dalek_ff_group::EdwardsPoint(
|
||||
self.0.key() - (*<Ed25519 as Ciphersuite>::G::generator() * self.0.key_offset()),
|
||||
self.0.key() - (*<Ed25519 as WrappedGroup>::generator() * self.0.key_offset()),
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user