We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ae49cad commit 6293f33Copy full SHA for 6293f33
ledger/src/account/account.rs
@@ -121,14 +121,12 @@ impl TokenSymbol {
121
}
122
123
pub fn to_field<F: FieldWitness>(&self) -> F {
124
- use ark_ff::FromBytes;
125
-
126
let mut s = <[u8; 32]>::default();
127
self.to_bytes(&mut s);
128
129
- let value = FromBytes::read(&s[..]).expect("Shoudn't fail");
130
- let bigint = BigInteger256::new(value);
131
- F::from(bigint) // Never fail, `self` contain 6 bytes at most
+ // There is an assumption that a token symbol is on 6 bytes, therefore
+ // it will be smaller than the order
+ F::from_le_bytes_mod_order(&s)
132
133
134
0 commit comments