Skip to content

Improve payload methods #17

@QYuQianchen

Description

@QYuQianchen

This could be more idiomatic in Rust by:

  1. creating a type encompassing the data necessary for the transformation:
pub struct TransferHoprTokenPayload {
    token_address: Address,
    address: Address,
    amount: U256,
}
  1. creating a TryFrom implementation for the TransactionRequest for this:
impl TryFrom<TransferHoprTokenPayload> for TransactionRequest {
}

Objects from 1. could be exported for public use, and used, e.g. in edgli to easily create a hidden transformation inside the library code, e.g. implementing the hopli library calls in terms of convertability, e.g.:

pub fn execute_payload_against(v: TryInto<TransactionRequest>)...

Originally posted by @Teebor-Choka in #15 (comment)

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