celestiaorg / rsmt2d

Go implementation of two dimensional Reed-Solomon merkle tree data availability scheme.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Return value of `setCell` isn't checked

rootulp opened this issue · comments

Context

eds.setCell(x, y, test.values[i])

Problem

After #172 setCell may return an error and indeed does when trying to overwrite a cell with nil. This means an error is going undetected in the test.

Proposal

Option A

Revert setCell to not perform input validation.

Option B

Check the the return value of setCell in the test. Fail the test if an error is observed.

Follow ups

#204

Based on the tests in extendeddatacrossword_test.go, the desired behavior is that setCell is able to overwrite cells with nil (see here)so going with Option A.