voucher-data #138

Merged
lash merged 18 commits from voucher-data into master 2024-10-31 13:44:19 +01:00
Showing only changes of commit e6a369dcdd - Show all commits

View File

@ -77,9 +77,6 @@ func MatchVoucher(input, symbols, balances, decimals, addresses string) (symbol,
for i, sym := range symList {
parts := strings.SplitN(sym, ":", 2)
if len(parts) != 2 {
continue
}
Alfred-mk marked this conversation as resolved Outdated
Outdated
Review

When will this condition occur?

When will this condition occur?

It will only occur if the string is not well formatted in the "1:SRF" format, such as it being "1SRF" or "1 SRF"

Ideally, this will not be encountered but I added this as an edge case in the unlikely event that it does

It will only occur if the string is not well formatted in the "1:SRF" format, such as it being "1SRF" or "1 SRF" Ideally, this will not be encountered but I added this as an edge case in the unlikely event that it does
Outdated
Review

but shouldnt that raise an error, as it should never happen?

but shouldnt that raise an error, as it should never happen?

On further assessment, I see it best to remove the code as the condition would never occur.

The data being matched comes from the db, and for this condition to occur means an issue lies with the functions that process and store the data

On further assessment, I see it best to remove the code as the condition would never occur. The data being matched comes from the db, and for this condition to occur means an issue lies with the functions that process and store the data
if input == parts[0] || strings.EqualFold(input, parts[1]) {
symbol = parts[1]