Skip to content

Commit

Permalink
Attempt to the fix
Browse files Browse the repository at this point in the history
  • Loading branch information
squadgazzz committed Oct 8, 2024
1 parent 5809401 commit 56f5358
Show file tree
Hide file tree
Showing 4 changed files with 388 additions and 88 deletions.
4 changes: 2 additions & 2 deletions crates/driver/src/domain/competition/solution/encoding.rs
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ struct Flags {
buy_token_balance: order::BuyTokenBalance,
}

mod codec {
pub mod codec {
use crate::domain::{competition::order, eth};

// cf. https://github.com/cowprotocol/contracts/blob/v1.5.0/src/contracts/libraries/GPv2Trade.sol#L16
Expand Down Expand Up @@ -392,7 +392,7 @@ mod codec {
)
}

pub(super) fn signature(signature: &order::Signature) -> super::Bytes<Vec<u8>> {
pub fn signature(signature: &order::Signature) -> super::Bytes<Vec<u8>> {
match signature.scheme {
order::signature::Scheme::Eip712 | order::signature::Scheme::EthSign => {
signature.data.clone()
Expand Down
4 changes: 2 additions & 2 deletions crates/driver/src/infra/api/routes/quote/dto/quote.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use {
crate::{
domain::{self, eth, quote},
domain::{self, competition::solution::encoding::codec, eth, quote},
util::serialize,
},
model::{
Expand Down Expand Up @@ -106,7 +106,7 @@ impl From<domain::competition::solution::trade::Jit> for JitOrder {
side: jit.order().side.into(),
sell_token_source: jit.order().sell_token_balance.into(),
buy_token_destination: jit.order().buy_token_balance.into(),
signature: jit.order().signature.data.clone().into(),
signature: codec::signature(&jit.order().signature).0,
signing_scheme: jit.order().signature.scheme.to_boundary_scheme(),
}
}
Expand Down
Loading

0 comments on commit 56f5358

Please sign in to comment.