trustlines-protocol / clientlib

Typescript/Javascript library of the trustlines network protocol
MIT License
10 stars 7 forks source link

Fix trustline updates with transfer of "0" #424

Closed compojoom closed 3 years ago

compojoom commented 3 years ago

If we are triyng to update a trustline and we pass a transfer value of "0"(string) the clientlib will call the overloaded updateTrustline function of the contract. This causes the meta transaction to fail as there is already an existing trustline and when updating we shouldn't be passing a transfer value.

cducrest commented 3 years ago

I think this is wrong, you don't allow for strings that are over the number limit for javascript. I would say we need to use something like calcRaw and then compare with bigNumber(0) https://github.com/trustlines-protocol/clientlib/blob/8b30ce108a7e5ec6e90ff3359c2c248ee8a330d4/src/utils.ts#L170

compojoom commented 3 years ago

yes, yes. You are right. That was what I thought on my way to work this morning... I'll have to figure something else.

codecov[bot] commented 3 years ago

Codecov Report

Merging #424 (d867cf1) into master (8b30ce1) will decrease coverage by 0.11%. The diff coverage is 0.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #424      +/-   ##
==========================================
- Coverage   59.14%   59.03%   -0.12%     
==========================================
  Files          21       21              
  Lines        1503     1506       +3     
  Branches      314      316       +2     
==========================================
  Hits          889      889              
- Misses        539      540       +1     
- Partials       75       77       +2     
Flag Coverage Δ
integration 32.07% <0.00%> (-0.07%) :arrow_down:
unit 59.03% <0.00%> (-0.12%) :arrow_down:

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
src/Trustline.ts 67.78% <0.00%> (-1.40%) :arrow_down:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 8b30ce1...d867cf1. Read the comment docs.