pinax-network / antelope.rs

Antelope Standard Library for Rust
https://docs.rs/antelope
Apache License 2.0
0 stars 0 forks source link

EOSIO Rust SymbolCode issue #1

Closed DenisCarriere closed 1 year ago

DenisCarriere commented 1 year ago

Using example Rust EOSIO library, doesn't produce the right SymbolCode

use eosio::*;

#[test]
fn test_symbol_code() {
    assert_eq!(SymbolCode::new(5197638).to_string(), "FOO");
    assert_eq!(Name::from_str("........dxboa").unwrap().as_u64(), 5197638);
}

❌ Failure

failures:

---- abi::test_symbol_code stdout ----
thread 'abi::test_symbol_code' panicked at 'assertion failed: `(left == right)`
  left: `"SOE"`,
 right: `"EOS"`', substreams/eosio.token/src/abi.rs:208:5
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Expected Output

$ eosc tools  names FOO

  from \ to    hex               hex_be            hex_rev_u32  name           uint64   symbol  symbol_code
  ---------    ---               ------            -----------  ----           ------   ------  -----------  
  name         0000000000000000  0000000000000000  ffffffff                    0        0,      -            
  symbol_code  464f4f0000000000  00000000004f4f46  ffb0b0b9     ........dxboa  5197638  70,OO   FOO          
YaroShkvorets commented 1 year ago

What do we want to do with it? The crate hasn't been updated for 3 years: https://crates.io/crates/eosio Do you know its maintainers?

DenisCarriere commented 1 year ago

SymbolCode .raw() & to_string() works with the current test cases