diff --git a/pallets/connectors/src/message.rs b/pallets/connectors/src/message.rs index 4b8227c35b..e522dc49d3 100644 --- a/pallets/connectors/src/message.rs +++ b/pallets/connectors/src/message.rs @@ -119,7 +119,10 @@ impl< message.append(&mut tranche_id.encode()); message.append(&mut token_name.encode()); message.append(&mut token_symbol.encode()); - message.append(&mut price.encode()); + + let mut encoded_price = price.encode(); + encoded_price.reverse(); + message.append(&mut encoded_price); message } @@ -274,7 +277,7 @@ mod tests { // We encode the encoded bytes as hex to verify it's what we expect let encoded_hex = hex::encode(encoded_bytes.clone()); - let expected_hex = "020000000000bce1a40000000000000000000000000000000105050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050606060606060606060606060606060606060606060606060606060606060606000000e83c80d09f3c2e3b0300000000"; + let expected_hex = "020000000000bce1a4000000000000000000000000000000010505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505060606060606060606060606060606060606060606060606060606060606060600000000033b2e3c9fd0803ce8000000"; assert_eq!(expected_hex, encoded_hex); // Now decode the bytes encoded as hex back to bytes and verify it's the same as