Closed cinlk closed 2 years ago
let bytes = hex2bytes_unchecked("0x000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000c10cc000808d24a072304e5a4cf436d3ef1f8a1353cc7e240b42446aadf7e6e4831e003c82b469000000000000000000000000d6117e0300000000000000000000008eaf04151687736326c9fea17e25fc5287613693c912909cb226aa4794f26a48003c82b469000000000000000000000000d6117e030000000000000000000000f41d3260d736f5b3db8a6351766e97619ea35972546a5f850bbf0b27764abe0300743ba40b000000000000000000000000d6117e03000000000000000000000000000000000000000000000000000000000000000000000000000000000000");
ket mut eth_decode = abi_decode_bytes(&bytes).unwrap();
let final_result: Vec<Relayer<AccountId32, u128>> = Decode::decode(&mut eth_decode.as_slice()).unwrap();
println!("bear: --- final {:?}", final_result);
// bear: --- final [Relayer { id: c000808d24a072304e5a4cf436d3ef1f8a1353cc7e240b42446aadf7e6e4831e (5GQTCZhz...), collateral: 454000000000, fee: 15000000000 }, Relayer { id: 8eaf04151687736326c9fea17e25fc5287613693c912909cb226aa4794f26a48 (5FHneW46...), collateral: 454000000000, fee: 15000000000 }, Relayer { id: f41d3260d736f5b3db8a6351766e97619ea35972546a5f850bbf0b27764abe03 (5HanDP7Y...), collateral: 50000000000, fee: 15000000000 }]
not the decodeUintCompact
problem . the reason is that this precompile returns an abi-encoded data.
@AsceticBear can we return non-abi-encoded data. I see the input data of precompile can be the non-abi-encoded data.
It's doable to return non-ethabi data in the state-storage
precompile in coing, but I am worried about it might break other applications using this precompile. What's the problem with the ethabi returned data here?
It's doable to return non-ethabi data in the
state-storage
precompile in coing, but I am worried about it might break other applications using this precompile. What's the problem with the ethabi returned data here?
I prefer returning non-abi-encoded data, because this is redundant. but if worried about breaking the existing code, I will add a abi.decode in solidity.
https://github.com/darwinia-network/darwinia-messages-sol/issues/200
keep abi encoded returning
the relayers bytes as follow come from feeMarket precompile calling
0x000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000c10cc000808d24a072304e5a4cf436d3ef1f8a1353cc7e240b42446aadf7e6e4831e003c82b469000000000000000000000000d6117e0300000000000000000000008eaf04151687736326c9fea17e25fc5287613693c912909cb226aa4794f26a48003c82b469000000000000000000000000d6117e030000000000000000000000f41d3260d736f5b3db8a6351766e97619ea35972546a5f850bbf0b27764abe0300743ba40b000000000000000000000000d6117e03000000000000000000000000000000000000000000000000000000000000000000000000000000000000
Those bytes could be decoded correctly by rust confirmed form @AsceticBear, But ScaleCode couldn't find relayers.