Skip to content

create a bounded vector type #2186

@DSharifi

Description

@DSharifi

Background

We are in the process of creating an SDK for the MPC contract. Currently for sign requests, we don't have proper DTO types, instead a local type defined in the contract SignRequestArgs.

The SignRequestArgs has fields for the payload, contain a special collection type Bytes which provides a bounded vector type over bytes.

We should move this bounded bytes type to the same collections crate where we have NonEmptyBtreeSet and NoEmptyBtreeMap, such that we can reuse the bounded bytes type in other crates where we serialize/deserialize signature request args without having to depend on the contract crate.

There is a quite sound implementation, with much better ergonomics and liberal license that we can copy https://github.com/ergoplatform/bounded-vec/blob/develop/src/bounded_vec.rs

User Story

No response

Acceptance Criteria

The Bytes type in the contract is removed, and is replaced in a separate crate.

Resources & Additional Notes

No response

Metadata

Metadata

Assignees

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