Skip to content

Commit

Permalink
chore: adapt to WSB v2.0.5
Browse files Browse the repository at this point in the history
  • Loading branch information
guidiaz committed Mar 5, 2024
1 parent 158fae7 commit 6406c4f
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 34 deletions.
72 changes: 42 additions & 30 deletions abis/WitnetPriceFeeds.json
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@
},
{
"internalType": "uint64",
"name": "witnessingFee",
"name": "witnessingFeeNanoWit",
"type": "uint64"
}
],
Expand Down Expand Up @@ -153,7 +153,7 @@
},
{
"internalType": "uint64",
"name": "witnessingFee",
"name": "witnessingFeeNanoWit",
"type": "uint64"
}
],
Expand Down Expand Up @@ -244,10 +244,22 @@
"type": "uint256"
},
{
"components": [
{
"internalType": "uint8",
"name": "committeeSize",
"type": "uint8"
},
{
"internalType": "uint64",
"name": "witnessingFeeNanoWit",
"type": "uint64"
}
],
"indexed": false,
"internalType": "uint64",
"name": "witTotalFee",
"type": "uint64"
"internalType": "struct WitnetV2.RadonSLA",
"name": "witnetSLA",
"type": "tuple"
}
],
"name": "WitnetQuery",
Expand All @@ -269,26 +281,7 @@
"type": "uint256"
}
],
"name": "WitnetQueryReported",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "uint256",
"name": "id",
"type": "uint256"
},
{
"indexed": false,
"internalType": "uint256",
"name": "evmReward",
"type": "uint256"
}
],
"name": "WitnetQueryRewardUpgraded",
"name": "WitnetQueryResponse",
"type": "event"
},
{
Expand All @@ -313,7 +306,7 @@
"type": "uint256"
}
],
"name": "WitnetResponseDelivered",
"name": "WitnetQueryResponseDelivered",
"type": "event"
},
{
Expand Down Expand Up @@ -350,7 +343,26 @@
"type": "string"
}
],
"name": "WitnetResponseDeliveryFailed",
"name": "WitnetQueryResponseDeliveryFailed",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "uint256",
"name": "id",
"type": "uint256"
},
{
"indexed": false,
"internalType": "uint256",
"name": "evmReward",
"type": "uint256"
}
],
"name": "WitnetQueryRewardUpgraded",
"type": "event"
},
{
Expand Down Expand Up @@ -718,7 +730,7 @@
},
{
"internalType": "uint64",
"name": "witnessingFee",
"name": "witnessingFeeNanoWit",
"type": "uint64"
}
],
Expand Down Expand Up @@ -1074,7 +1086,7 @@
},
{
"internalType": "uint64",
"name": "witnessingFee",
"name": "witnessingFeeNanoWit",
"type": "uint64"
}
],
Expand Down Expand Up @@ -1105,7 +1117,7 @@
},
{
"internalType": "uint64",
"name": "witnessingFee",
"name": "witnessingFeeNanoWit",
"type": "uint64"
}
],
Expand Down
8 changes: 4 additions & 4 deletions price_feeds_poller.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,8 +158,8 @@ def handle_loop(
priceSolver = feeds.functions.lookupPriceSolver(pf_id).call()
routed = priceSolver[0] != "0x0000000000000000000000000000000000000000"
if routed == False:
bytecode = feeds.functions.lookupBytecode(pf_id).call()
rad_hash = feeds.functions.lookupRadHash(pf_id).call().hex()
bytecode = feeds.functions.lookupWitnetBytecode(pf_id).call()
rad_hash = feeds.functions.lookupWitnetRadHash(pf_id).call().hex()
else:
bytecode = ""
rad_hash = ""
Expand Down Expand Up @@ -260,7 +260,7 @@ def handle_loop(

# Detect eventual RAD updates:
if timer_out and pf['isRouted'] == False:
rad_hash = feeds.functions.lookupRadHash(id).call().hex()
rad_hash = feeds.functions.lookupWitnetRadHash(id).call().hex()
if pf['radHash'] != rad_hash:
config = load_price_feeds_config(feeds_config_file_path, network_name)
print(f"{caption} <> contract RAD hash changed to {rad_hash}")
Expand All @@ -274,7 +274,7 @@ def handle_loop(
pf["heartbeat"] = int(config['feeds'][pf['caption']].get("maxSecsBetweenUpdates", 0))

# read from web3
pf["bytecode"] = feeds.functions.lookupBytecode(id).call()
pf["bytecode"] = feeds.functions.lookupWitnetBytecode(id).call()

# reset flags
pf["fees"].clear()
Expand Down

0 comments on commit 6406c4f

Please sign in to comment.