Closed clangenb closed 1 year ago
Can you please explain point 3 a bit more?
I see we now have to pass the file contents as string
and the parameter type is already String
e.g orders_file: String,
.
I think we just need to remove one extra step of reading the contents from the file.
You are right: in step 2 we can actually still just supply the path to the file. It is ok if the CLI reads it from the file, but the enclave must not. This is why the trusted call needs to look like this now:
enum TrustedCall {
pay_as_bid(AccountId, Vec<Orders>)
}
So here we need to read the file in the CLI and supply it as a field of the trusted call: https://github.com/olisystems/BEST-Energy/blob/0d80464657d91feff6106cda7db3c12ee0eb7f95/cli/src/trusted_base_cli/commands/pay_as_bid.rs#L51
Closing this one as completed, the tracking issue of enabling sending the requests from other clients is in #34.
OLI wants to send the orders from the market engine directly and with their own client instead of our rust-cli. The first step would be to change the rust-cli to handle this, which is straight forward.
pay_as_bid
command to be the json content of the orders instead of the pathpay_as_bid
command, we parse the input:let orders: Vec<Orders> = serde_json::from_str(input)
.TrustedCall
field is no longer a String, but aVec<Orders>