Skip to content

is read_value_from_input convoluted  #166

Description

@skaunov

Is https://docs.rs/tasm-lib/latest/tasm_lib/data_type/enum.DataType.html#method.read_value_from_input quite misleading then? @jan-ferdinand

I mean will it then read just one word which I guess will the start of the encoding?

If I want to use the method for the following -- how do I do that?

        let to_be_call = DataType::StructRef(
            StructType{ name: "MmrAccumulator".into(), fields: vec!(
                ("leaf_count".into(), DataType::U64), ("peaks".into(), DataType::List(DataType::Digest.into()))
            ) }
        ).read_value_from_input(tasm_lib::io::InputSource::StdIn);

It seems to me that that method can only be used to read stack-based values (tuples, and primitive types like BFieldElement, Digest, u128 etc.).

Originally posted by @Sword-Smith in #163 (comment)

It looks to me as a refactoring candidate if the above is confirmed. Though I probably just missed a thing.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions