Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions .github/workflows/sharing-smart-contract-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -83,13 +83,16 @@ jobs:
echo "Error: Anvil did not start within the timeout period."
exit 1

- name: Hardhat Tests
- name: Upgrade test
working-directory: packages/sharing-smart-contract
run: npm run test -- --network ci-bellecour-fork
run: npm run upgrade-local-fork -- --network local-bellecour-fork

- name: Upgrade Test
# TODO check why the CI does not fail when the following error occurs
# (when the RPC node is not available):
# 1) Uncaught error outside test suite
- name: Hardhat tests
working-directory: packages/sharing-smart-contract
run: npm run upgrade-local-fork -- --network local-bellecour-fork
run: npm run test -- --network local-bellecour-fork

- name: Set Directory Permissions
working-directory: packages/sharing-smart-contract
Expand Down
2 changes: 1 addition & 1 deletion environments/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import { getEnvironment } from "@iexec/dataprotector-environments";
const {
smsUrl,
iexecGatewayUrl,
resultProxyUrl,
resultProxyUrl, // TODO remove
ipfsGatewayUrl,
ipfsNodeUrl,
workerpoolProdAddress,
Expand Down
2 changes: 1 addition & 1 deletion environments/common/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export const KNOWN_KEYS = [
// iexec protocol config
"smsUrl",
"iexecGatewayUrl",
"resultProxyUrl",
"resultProxyUrl", // TODO remove
"ipfsGatewayUrl",
"ipfsNodeUrl",
"workerpoolProdAddress",
Expand Down
2 changes: 1 addition & 1 deletion environments/types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ export declare type KnownEnv = "prod" | "staging";
export declare type EnvKey =
| "smsUrl"
| "iexecGatewayUrl"
| "resultProxyUrl"
| "resultProxyUrl" // TODO remove
| "ipfsGatewayUrl"
| "ipfsNodeUrl"
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2007,11 +2007,6 @@
"internalType": "string",
"name": "iexecResultStorageProvider_",
"type": "string"
},
{
"internalType": "string",
"name": "iexecResultStorageProxy_",
"type": "string"
}
],
"name": "updateEnv",
Expand Down
2 changes: 1 addition & 1 deletion packages/sdk/tests/test-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const TEST_CHAIN = {
smsDebugURL: DRONE ? 'http://sms-debug:13300' : 'http://127.0.0.1:13301',
resultProxyURL: DRONE
? 'http://result-proxy:13200'
: 'http://127.0.0.1:13200',
: 'http://127.0.0.1:13200', // TODO remove
iexecGatewayURL: DRONE ? 'http://market-api:3000' : 'http://127.0.0.1:3000',
provider: new JsonRpcProvider(
DRONE ? 'http://bellecour-fork:8545' : 'http://localhost:8545'
Expand Down
1 change: 1 addition & 0 deletions packages/sharing-smart-contract/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ All notable changes to this project will be documented in this file.

### Changed

- [BREAKING] Remove result proxy url from contract config and deal params (#438).
- Fix Sharing contract constructor arguments order (#433)
- Update blockscout url

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2007,11 +2007,6 @@
"internalType": "string",
"name": "iexecResultStorageProvider_",
"type": "string"
},
{
"internalType": "string",
"name": "iexecResultStorageProxy_",
"type": "string"
}
],
"name": "updateEnv",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ contract DataProtectorSharing is
__AccessControl_init();
_grantRole(DEFAULT_ADMIN_ROLE, msg.sender);

updateEnv("ipfs", "https://result.v8-bellecour.iex.ec");
updateEnv("ipfs");
}

/***************************************************************************
Expand Down Expand Up @@ -261,11 +261,9 @@ contract DataProtectorSharing is
* Admin *
**************************************************************************/
function updateEnv(
string memory iexecResultStorageProvider_,
string memory iexecResultStorageProxy_
string memory iexecResultStorageProvider_
) public onlyRole(DEFAULT_ADMIN_ROLE) {
_iexecResultStorageProvider = iexecResultStorageProvider_;
_iexecResultStorageProxy = iexecResultStorageProxy_;
}

/***************************************************************************
Expand Down
4 changes: 2 additions & 2 deletions packages/sharing-smart-contract/contracts/ManageOrders.sol
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ abstract contract ManageOrders {
0x0000000000000000000000000000000000000000000000000000000000000003; // [tee,scone]
uint256 internal constant TRUST = 0; // No replication
string internal _iexecResultStorageProvider;
// [WARNING] This value is not used anymore but it must be kept
// to not break deployed proxies when upgrading them.
string internal _iexecResultStorageProxy;
uint256 private _salt;

Expand Down Expand Up @@ -166,8 +168,6 @@ abstract contract ManageOrders {
'{"iexec_result_encryption":true', // solhint-disable-line quotes
',"iexec_result_storage_provider":"', // solhint-disable-line quotes
_iexecResultStorageProvider,
'","iexec_result_storage_proxy":"', // solhint-disable-line quotes
_iexecResultStorageProxy,
'"}' // solhint-disable-line quotes
);
}
Expand Down
6 changes: 1 addition & 5 deletions packages/sharing-smart-contract/hardhat.config.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ require('@nomicfoundation/hardhat-foundry');
require('@nomicfoundation/hardhat-toolbox');
require('@openzeppelin/hardhat-upgrades');
require('hardhat-contract-sizer');
require('@openzeppelin/hardhat-upgrades');
require('dotenv').config();

const { WALLET_PRIVATE_KEY } = process.env;
Expand All @@ -17,7 +18,6 @@ const bellecourBase = {
*/
module.exports = {
// run `npx hardhat node` to start the forked bellecour node "local-bellecour-fork"
defaultNetwork: 'local-bellecour-fork',
networks: {
hardhat: {
...bellecourBase,
Expand All @@ -31,10 +31,6 @@ module.exports = {
...bellecourBase,
url: 'http://127.0.0.1:8545',
},
'ci-bellecour-fork': {
...bellecourBase,
url: 'http://bellecour-fork:8545',
},
bellecour: {
...bellecourBase,
url: 'https://bellecour.iex.ec',
Expand Down
11 changes: 7 additions & 4 deletions packages/sharing-smart-contract/scripts/updateEnv.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,14 @@ const { ethers } = pkg;
async function main() {
const { ENV } = env;
console.log(`using ENV: ${ENV}`);
const { dataprotectorSharingContractAddress, resultProxyUrl } = getEnvironment(ENV);
const { dataprotectorSharingContractAddress } = getEnvironment(ENV);

const newEnv = ['ipfs', resultProxyUrl];
const newResultStorageProvider = 'ipfs';

console.log(`UpdateEnv Contract at ${dataprotectorSharingContractAddress} with [${newEnv}]`);
console.log(
`UpdateEnv contract at ${dataprotectorSharingContractAddress} ` +
`[newResultStorageProvider=${newResultStorageProvider}]`,
);
const [admin] = await ethers.getSigners();
console.log(`using wallet ${admin.address}`);

Expand All @@ -20,7 +23,7 @@ async function main() {
dataprotectorSharingContractAddress,
);

const updateEnvTx = await dataProtectorSharingContract.updateEnv(...newEnv);
const updateEnvTx = await dataProtectorSharingContract.updateEnv(newResultStorageProvider);
console.log(`tx: ${updateEnvTx.hash}`);

await updateEnvTx.wait();
Expand Down
5 changes: 0 additions & 5 deletions packages/subgraph/abis/DataProtectorSharingABI.json
Original file line number Diff line number Diff line change
Expand Up @@ -2007,11 +2007,6 @@
"internalType": "string",
"name": "iexecResultStorageProvider_",
"type": "string"
},
{
"internalType": "string",
"name": "iexecResultStorageProxy_",
"type": "string"
}
],
"name": "updateEnv",
Expand Down
Loading