Skip to content

[Request]: Consider Returning false if missing accreditation to attest in validate_propperty #137

@wulfraem

Description

@wulfraem

It may be helpful, if validate_property would return false instead of aborting if a given attester_id does not have any accreditations to attest.

Details

The implementation of validate_property seems to favor returning false for invalid properties, as its return value is bool. But if having no accreditation to attest at all, the execution is aborted with an error:

Error executing transaction '...': 1st command aborted within function
'0x02::vec_map::get_idx' at instruction 9 with code 1

(Truncated tx hash and package address for readability).

This seems to come from the get in get_accreditations_to_attest, so maybe we could check, if that key has a value and just return false before trying to access it.

Maybe it's worth to also check similar functions for the same behavior, e.g. get_accreditations_to_accredit also uses the get function.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status

    Product Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions