XRPL-Labs / xrpld-hooks

ISC License
94 stars 28 forks source link

hook_account() not returning OUT_OF_BOUNDS error #12

Closed technotip closed 1 year ago

technotip commented 3 years ago

Issue Description

hook_account API not returning the error code -1, which corresponds to OUT_OF_BOUNDS.

Steps to Reproduce

    { 
        uint8_t hook_acc_id[20];
        int64_t result = hook_account(hook_acc_id, 999999999); // 2nd parameter is invalid.

        trace_num(SBUF("Testcase: no of bytes written "), result);

        if(result != 20)
                rollback(SBUF("Testcase2: Couldn't fetch the hook account."), 1);

        trace(SBUF("Testcase2: hook_acc_id "), SBUF(hook_acc_id), 1);

    } 

Expected Result

Above code is expected to return error code -1, which corresponds to OUT_OF_BOUNDS.

Actual Result

It's returning the code 20, indicating that its writing 20 bytes of data to buffer referenced by hook_acc_id.

RichardAH commented 1 year ago

This is fixed on latest