[marketplace] Use dynamically sized arrays for PoR
ABI encoding sometimes fails on large byte arrays of fixed size.
This commit is contained in:
parent
b145e66a68
commit
6aa2894521
|
@ -95,8 +95,6 @@ contract Marketplace is Collateral {
|
||||||
return requestState[requestId].selectedOffer;
|
return requestState[requestId].selectedOffer;
|
||||||
}
|
}
|
||||||
|
|
||||||
uint256 private constant POR_SECTORS = 10; // amount of sectors in PoR scheme
|
|
||||||
|
|
||||||
struct Request {
|
struct Request {
|
||||||
address client;
|
address client;
|
||||||
Ask ask;
|
Ask ask;
|
||||||
|
@ -125,9 +123,9 @@ contract Marketplace is Collateral {
|
||||||
}
|
}
|
||||||
|
|
||||||
struct PoR {
|
struct PoR {
|
||||||
bytes1[POR_SECTORS * 48] u; // parameters u_1..u_s
|
bytes u; // parameters u_1..u_s
|
||||||
bytes1[96] publicKey; // public key
|
bytes publicKey; // public key
|
||||||
bytes1[512] name; // random name
|
bytes name; // random name
|
||||||
}
|
}
|
||||||
|
|
||||||
struct RequestState {
|
struct RequestState {
|
||||||
|
|
|
@ -4,7 +4,7 @@ const { keccak256, defaultAbiCoder } = ethers.utils
|
||||||
function requestId(request) {
|
function requestId(request) {
|
||||||
const Ask = "tuple(uint256, uint256, uint256, uint256)"
|
const Ask = "tuple(uint256, uint256, uint256, uint256)"
|
||||||
const Erasure = "tuple(uint64, uint64, uint64)"
|
const Erasure = "tuple(uint64, uint64, uint64)"
|
||||||
const PoR = "tuple(bytes1[480], bytes1[96], bytes1[512])"
|
const PoR = "tuple(bytes, bytes, bytes)"
|
||||||
const Content = "tuple(string, " + Erasure + ", " + PoR + ")"
|
const Content = "tuple(string, " + Erasure + ", " + PoR + ")"
|
||||||
const Request =
|
const Request =
|
||||||
"tuple(address, " + Ask + ", " + Content + ", uint256, bytes32)"
|
"tuple(address, " + Ask + ", " + Content + ", uint256, bytes32)"
|
||||||
|
|
Loading…
Reference in New Issue