Skip to content

Commit ff0b386

Browse files
committed
Fix: Revert deserializeBytesBigInt to deserializeBigInt in MarketCBOR.sol
Switched back to using deserializeBigInt for balance, locked, storage_price_per_epoch, provider_collateral, and client_collateral fields to fix deserialization issues and pass all tests.
1 parent 09f2f20 commit ff0b386

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

contracts/v0.8/cbor/MarketCbor.sol

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,12 @@ import "../utils/CborDecode.sol";
3131
import "./FilecoinCbor.sol";
3232
import "./BigIntCbor.sol";
3333
import "./FilecoinCbor.sol";
34-
import "./BytesCbor.sol";
3534

3635
/// @title This library is a set of functions meant to handle CBOR parameters serialization and return values deserialization for Market actor exported methods.
3736
/// @author Zondax AG
3837
library MarketCBOR {
3938
using CBOR for CBOR.CBORBuffer;
4039
using CBORDecoder for bytes;
41-
using BytesCBOR for bytes;
4240

4341
using BigIntCBOR for *;
4442
using FilecoinCBOR for *;
@@ -74,10 +72,10 @@ library MarketCBOR {
7472
assert(len == 2);
7573

7674
(tmp, byteIdx) = rawResp.readBytes(byteIdx);
77-
ret.balance = tmp.deserializeBytesBigInt();
75+
ret.balance = tmp.deserializeBigInt();
7876

7977
(tmp, byteIdx) = rawResp.readBytes(byteIdx);
80-
ret.locked = tmp.deserializeBytesBigInt();
78+
ret.locked = tmp.deserializeBigInt();
8179

8280
return ret;
8381
}
@@ -299,14 +297,14 @@ library MarketCBOR {
299297

300298
bytes memory storage_price_per_epoch_bytes;
301299
(storage_price_per_epoch_bytes, byteIdx) = rawResp.readBytes(byteIdx);
302-
ret.storage_price_per_epoch = storage_price_per_epoch_bytes.deserializeBytesBigInt();
300+
ret.storage_price_per_epoch = storage_price_per_epoch_bytes.deserializeBigInt();
303301

304302
bytes memory provider_collateral_bytes;
305303
(provider_collateral_bytes, byteIdx) = rawResp.readBytes(byteIdx);
306-
ret.provider_collateral = provider_collateral_bytes.deserializeBytesBigInt();
304+
ret.provider_collateral = provider_collateral_bytes.deserializeBigInt();
307305

308306
bytes memory client_collateral_bytes;
309307
(client_collateral_bytes, byteIdx) = rawResp.readBytes(byteIdx);
310-
ret.client_collateral = client_collateral_bytes.deserializeBytesBigInt();
308+
ret.client_collateral = client_collateral_bytes.deserializeBigInt();
311309
}
312310
}

0 commit comments

Comments
 (0)