Skip to content

Commit

Permalink
Merge pull request #240 from dcSpark/address-trailing-whitelist
Browse files Browse the repository at this point in the history
Expand whitelist for trailing data addresses
  • Loading branch information
gostkin authored Jul 14, 2023
2 parents 1c133c4 + 5630e76 commit 648460b
Showing 1 changed file with 26 additions and 4 deletions.
30 changes: 26 additions & 4 deletions chain/rust/src/address.rs
Original file line number Diff line number Diff line change
Expand Up @@ -249,10 +249,32 @@ impl Address {
data: &[u8],
bytes_encoding: Option<StringEncoding>,
) -> Result<Address, DeserializeError> {
const TRAILING_WHITELIST: [&[u8]; 1] = [&[
203, 87, 175, 176, 179, 95, 200, 156, 99, 6, 28, 153, 20, 224, 85, 0, 26, 81, 140, 117,
22,
]];
const TRAILING_WHITELIST: [&[u8]; 8] = [
&[
203, 87, 175, 176, 179, 95, 200, 156, 99, 6, 28, 153, 20, 224, 85, 0, 26, 81, 140, 117, 22
],
&[
19, 213, 244, 163, 254, 4, 120, 178, 36, 30, 1, 104, 227, 203, 165, 0, 26, 34, 193, 90, 17
],
&[
0
],
&[
106, 51, 48, 102, 53, 97, 109, 107, 119, 104, 119, 113, 97, 52, 119, 118, 102, 121, 106, 100, 101, 122, 121, 97, 101, 108, 109, 110, 110, 103, 100, 54, 100, 52, 101
],
&[
53, 97, 99, 121, 50, 114, 48, 101, 107, 114, 112, 113, 122, 113, 106, 108, 113, 100, 107, 56, 108, 122, 113, 110, 53, 114, 52, 53, 110
],
&[
6, 29, 7, 12, 13, 4, 27, 7, 2, 15, 11, 13, 11, 15, 2, 9, 18, 5, 29, 28, 16, 9, 17, 4, 14, 31, 7, 19, 17, 3, 1, 0, 11, 16, 22, 0
],
&[
18, 110, 119, 53, 51, 53, 103, 54, 118, 115, 112, 55, 120, 55, 102, 104, 120, 112, 113, 50, 112, 116, 115, 104, 57, 103, 107, 114
],
&[
44
]
];
(|| -> Result<Self, DeserializeError> {
let header = data[0];
let network = header & 0x0F;
Expand Down

0 comments on commit 648460b

Please sign in to comment.