Skip to content

Commit afea190

Browse files
fix #1: remove oracle types, triggered by change in gif-interface
1 parent 8b44b31 commit afea190

File tree

14 files changed

+11
-119
lines changed

14 files changed

+11
-119
lines changed

README.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,12 @@ Start the "Fire Insurance" API sever.
140140
uvicorn server.api:app --log-level info --host 0.0.0.0 --reload
141141
```
142142

143-
After the application startup has completed open the OpenAPI UI in your web browser
143+
In case the above command leads to error messages like
144+
`brownie.exceptions.ContractNotFound: No contract deployed at 0x...`
145+
this might caused by brownie book keeping of previous contracts that is probably not relevant in your situation.
146+
In this case delete the files in directory `build/deployments/*` and try to start the API server again.
147+
148+
After the application startup has completed successfully open the OpenAPI UI in your web browser
144149
[http://localhost:8000/docs](http://localhost:8000/docs).
145150

146151
### Deploy the "Fire Insurance" Product

brownie-config.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ compiler:
99
# https://eth-brownie.readthedocs.io/en/stable/compile.html#compiler-settings
1010
remappings:
1111
- "@openzeppelin=OpenZeppelin/openzeppelin-contracts@4.5.0"
12-
- "@gif-interface=etherisc/gif-interface@1.2.0-staging-b"
12+
- "@gif-interface=etherisc/gif-interface@1.3.0-staging"
1313
vyper:
1414
version: null
1515

@@ -19,7 +19,7 @@ compiler:
1919
dependencies:
2020
# github dependency format: <owner>/<repository>@<release>
2121
- OpenZeppelin/openzeppelin-contracts@4.5.0
22-
- etherisc/gif-interface@1.2.0-staging-b
22+
- etherisc/gif-interface@1.3.0-staging
2323

2424
# exclude Ownable when calculating test coverage
2525
# https://eth-brownie.readthedocs.io/en/v1.10.3/config.html#exclude_paths

contracts/example/fire/FireInsurance.sol

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ contract FireInsurance is Product {
1717
string public constant CALLBACK_METHOD_NAME = "oracleCallback";
1818

1919
// variables
20-
bytes32 public fireOracleType;
2120
uint256 public fireOracleId;
2221
uint256 public uniqueIndex;
2322

@@ -33,12 +32,10 @@ contract FireInsurance is Product {
3332
constructor(
3433
address gifProductService,
3534
bytes32 productName,
36-
bytes32 oracleType,
3735
uint256 oracleId
3836
)
3937
Product(gifProductService, productName, POLICY_FLOW)
4038
{
41-
fireOracleType = oracleType;
4239
fireOracleId = oracleId;
4340
}
4441

@@ -81,7 +78,6 @@ contract FireInsurance is Product {
8178
policyId,
8279
abi.encode(objectName),
8380
CALLBACK_METHOD_NAME,
84-
fireOracleType,
8581
fireOracleId
8682
);
8783

contracts/example/fire/FireOracle.sol

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,9 @@ contract FireOracle is Oracle {
1111
constructor(
1212
address gifOracleService,
1313
address gifOracleOwnerService,
14-
bytes32 oracleTypeName,
1514
bytes32 oracleName
1615
)
17-
Oracle(gifOracleService, gifOracleOwnerService, oracleTypeName, oracleName)
16+
Oracle(gifOracleService, gifOracleOwnerService, oracleName)
1817
{ }
1918

2019
function request(uint256 requestId, bytes calldata input)

contracts/example/helloworld/HelloWorldInsurance.sol

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ contract HelloWorldInsurance is IHelloWorldInsurance, Product {
2222
string public constant CALLBACK_METHOD_NAME = "greetingCallback";
2323

2424
uint256 public uniqueIndex;
25-
bytes32 public greetingsOracleType;
2625
uint256 public greetingsOracleId;
2726

2827
mapping(bytes32 => address) public policyIdToAddress;
@@ -31,12 +30,10 @@ contract HelloWorldInsurance is IHelloWorldInsurance, Product {
3130
constructor(
3231
address gifProductService,
3332
bytes32 productName,
34-
bytes32 oracleType,
3533
uint256 oracleId
3634
)
3735
Product(gifProductService, productName, POLICY_FLOW)
3836
{
39-
greetingsOracleType = oracleType;
4037
greetingsOracleId = oracleId;
4138
}
4239

@@ -76,7 +73,6 @@ contract HelloWorldInsurance is IHelloWorldInsurance, Product {
7673
policyId,
7774
abi.encode(greeting),
7875
CALLBACK_METHOD_NAME,
79-
greetingsOracleType,
8076
greetingsOracleId
8177
);
8278

contracts/example/helloworld/HelloWorldOracle.sol

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,9 @@ contract HelloWorldOracle is Oracle {
2020
constructor(
2121
address gifOracleService,
2222
address gifOracleOwnerService,
23-
bytes32 oracleTypeName,
2423
bytes32 oracleName
2524
)
26-
Oracle(gifOracleService, gifOracleOwnerService, oracleTypeName, oracleName)
25+
Oracle(gifOracleService, gifOracleOwnerService, oracleName)
2726
{ }
2827

2928
function request(uint256 requestId, bytes calldata input)

contracts/example/test/TestOracle.sol

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,9 @@ contract TestOracle is Oracle {
99
constructor(
1010
address gifOracleService,
1111
address gifOracleOwnerService,
12-
bytes32 oracleTypeName,
1312
bytes32 oracleName
1413
)
15-
Oracle(gifOracleService, gifOracleOwnerService, oracleTypeName, oracleName)
14+
Oracle(gifOracleService, gifOracleOwnerService, oracleName)
1615
{ }
1716

1817
function request(uint256 requestId, bytes calldata input) external override onlyQuery {

contracts/example/test/TestProduct.sol

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,6 @@ contract TestProduct is Product {
6363
policyId,
6464
abi.encode(_claims),
6565
ORACLE_CALLBACK_METHOD_NAME,
66-
_testOracleType,
6766
_testOracleId
6867
);
6968
}

contracts/shared/InstanceHelper.sol

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ contract InstanceHelper {
2828
_productService = IProductService(_registry.getContractFromRegistry(PRODUCT_SERVICE));
2929
}
3030

31-
function oracleTypes() external view returns (uint256) { return _operatorService.oracleTypes(); }
3231
function oracles() external view returns (uint256) { return _operatorService.oracles(); }
3332
function products() external view returns (uint256) { return _operatorService.products(); }
3433

scripts/fire.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,6 @@ def __init__(
2121
'Fire',
2222
FireInsurance,
2323
productOwner,
24-
'(bytes input)',
25-
'(bytes1 fireCategory)',
2624
FireOracle,
2725
oracleOwner,
2826
instance,

0 commit comments

Comments
 (0)