From 59fae90fd6c01c9023cc9c08bc4202f1f15ef3d9 Mon Sep 17 00:00:00 2001 From: David Vilela Date: Tue, 12 Nov 2024 08:36:34 +0100 Subject: [PATCH] fix: user epoch --- docs/index.md | 2 +- packages/packages.json | 10 ++++----- .../agents/impact_evaluator/aea-config.yaml | 4 ++-- .../services/impact_evaluator/service.yaml | 2 +- .../impact_evaluator_local/service.yaml | 2 +- .../skills/impact_evaluator_abci/skill.yaml | 2 +- .../skills/twitter_scoring_abci/behaviours.py | 21 ++++++++++--------- .../skills/twitter_scoring_abci/skill.yaml | 2 +- 8 files changed, 23 insertions(+), 22 deletions(-) diff --git a/docs/index.md b/docs/index.md index 73ef75b6..b6448c14 100644 --- a/docs/index.md +++ b/docs/index.md @@ -31,7 +31,7 @@ In order to run a local demo service based on the IEKit: 2. Fetch the IEKit. ```bash - autonomy fetch valory/impact_evaluator:0.1.0:bafybeidmt7obmuz2bdqdomgylgapokih7jwjwn57pq6daiizgkzq3gkcdu --service + autonomy fetch valory/impact_evaluator:0.1.0:bafybeib2doczuv4qoru7xxvinakmbhg73cw72mauhjek7vgi2jlngl4gvy --service ``` 3. Build the Docker image of the service agents diff --git a/packages/packages.json b/packages/packages.json index 475543a2..1882d88c 100644 --- a/packages/packages.json +++ b/packages/packages.json @@ -15,10 +15,10 @@ "connection/valory/openai/0.1.0": "bafybeifz2n6s6u3zvvryhhxpkvn6guyp2jwpagtyjducvgwoldtmz7ea64", "connection/valory/farcaster/0.1.0": "bafybeibbdas7lxbipksodaphjms3uop7vnzjqkroktjq2g6wbvgtlldaxi", "skill/valory/dynamic_nft_abci/0.1.0": "bafybeidrfsjm75ixwhud4vrxaswj7rlviervh2waquafedrcr2mipts26y", - "skill/valory/twitter_scoring_abci/0.1.0": "bafybeidqaj3j73v73f725ubv6vecfrvvmmxpfyzm6oro7rmnmslxaaq65e", + "skill/valory/twitter_scoring_abci/0.1.0": "bafybeig62izsraoluo7kai7te2pcwgy7utbxldklawpw3itwhyyvwelifq", "skill/valory/ceramic_read_abci/0.1.0": "bafybeigz7rzfls3niv3urfb4z4vwr525ooxveelgg3djpvkg5jzetxlm2u", "skill/valory/ceramic_write_abci/0.1.0": "bafybeic6c3iub3nsr5tmr7g5vzoixbin6w64ewudfiq6u4r2fiqwbg753i", - "skill/valory/impact_evaluator_abci/0.1.0": "bafybeiapzvtsptv6mlunhhhqcxvn4ogt672zgho3zymwarwlfum5oincwu", + "skill/valory/impact_evaluator_abci/0.1.0": "bafybeiexhxom7fp7t3mbvrtnlgo5r45dnap2b4jnwkt56p37dyikdyi74q", "skill/valory/generic_scoring_abci/0.1.0": "bafybeif46mwn3oxfqu7i5tg6trce3t7koa3vmbrub47ffz7gcr5p6qlvri", "skill/valory/twitter_write_abci/0.1.0": "bafybeibp7zai2qwvfjd5fgpayx44x5c2zshbukpobvz2la7ws2l5f5fjde", "skill/valory/llm_abci/0.1.0": "bafybeib2k62hilwglfad33bzxkjlviw5bxwiw7z3rjvweyeamatdjznpeq", @@ -28,10 +28,10 @@ "skill/valory/farcaster_write_abci/0.1.0": "bafybeigx2wyujnojer7er7g2eufm5lojon2dckotvsgwb6tn5iyiwdfgsu", "skill/valory/farcaster_test_abci/0.1.0": "bafybeihd3h37ngkxlqo6o3vuvdik54bwmbrjmqcxtgsr5is3tqgbk73yoa", "skill/valory/staking_abci/0.1.0": "bafybeieutg3epfnqtaucw6rpkq7vzzt5pkziqt4zlpjmispz2gqzth45ay", - "agent/valory/impact_evaluator/0.1.0": "bafybeiahkygqtth6nmhg6qg4bnlxkb5gcbcercadw43fpbxaicowghbg7q", + "agent/valory/impact_evaluator/0.1.0": "bafybeibu43hbpldh6xhgrv5f2gp3cougpbwsforvqwgh6khklla6s6upfu", "agent/valory/farcaster_test/0.1.0": "bafybeiefui6dnhhy5leqyvfrbkeleb64gap5tzctkrzzggjf4ubbxamjvy", - "service/valory/impact_evaluator/0.1.0": "bafybeidmt7obmuz2bdqdomgylgapokih7jwjwn57pq6daiizgkzq3gkcdu", - "service/valory/impact_evaluator_local/0.1.0": "bafybeif2lj57ys2j5yfmdruudxst6rhpymkaoh5en5vyomt72pa74d7iti" + "service/valory/impact_evaluator/0.1.0": "bafybeib2doczuv4qoru7xxvinakmbhg73cw72mauhjek7vgi2jlngl4gvy", + "service/valory/impact_evaluator_local/0.1.0": "bafybeiexxk3qtqodnoflpaczdy7lhpofm3b7vxqurvdpsn4ivblxv3qlta" }, "third_party": { "protocol/open_aea/signing/1.0.0": "bafybeihv62fim3wl2bayavfcg3u5e5cxu3b7brtu4cn5xoxd6lqwachasi", diff --git a/packages/valory/agents/impact_evaluator/aea-config.yaml b/packages/valory/agents/impact_evaluator/aea-config.yaml index 9b116890..d0afc90f 100644 --- a/packages/valory/agents/impact_evaluator/aea-config.yaml +++ b/packages/valory/agents/impact_evaluator/aea-config.yaml @@ -45,9 +45,9 @@ protocols: skills: - valory/abstract_abci:0.1.0:bafybeieo7pe5wqjphs5izpz5aujjbubymlxub62b3rhx6yglu65ibalffu - valory/abstract_round_abci:0.1.0:bafybeibiw4oqwqvo4jccwz5fb73iardzychgvcl66tceiildohoju2ikti -- valory/impact_evaluator_abci:0.1.0:bafybeiapzvtsptv6mlunhhhqcxvn4ogt672zgho3zymwarwlfum5oincwu +- valory/impact_evaluator_abci:0.1.0:bafybeiexhxom7fp7t3mbvrtnlgo5r45dnap2b4jnwkt56p37dyikdyi74q - valory/generic_scoring_abci:0.1.0:bafybeif46mwn3oxfqu7i5tg6trce3t7koa3vmbrub47ffz7gcr5p6qlvri -- valory/twitter_scoring_abci:0.1.0:bafybeidqaj3j73v73f725ubv6vecfrvvmmxpfyzm6oro7rmnmslxaaq65e +- valory/twitter_scoring_abci:0.1.0:bafybeig62izsraoluo7kai7te2pcwgy7utbxldklawpw3itwhyyvwelifq - valory/ceramic_read_abci:0.1.0:bafybeigz7rzfls3niv3urfb4z4vwr525ooxveelgg3djpvkg5jzetxlm2u - valory/ceramic_write_abci:0.1.0:bafybeic6c3iub3nsr5tmr7g5vzoixbin6w64ewudfiq6u4r2fiqwbg753i - valory/dynamic_nft_abci:0.1.0:bafybeidrfsjm75ixwhud4vrxaswj7rlviervh2waquafedrcr2mipts26y diff --git a/packages/valory/services/impact_evaluator/service.yaml b/packages/valory/services/impact_evaluator/service.yaml index 7d8e5b15..6da0cf80 100644 --- a/packages/valory/services/impact_evaluator/service.yaml +++ b/packages/valory/services/impact_evaluator/service.yaml @@ -8,7 +8,7 @@ license: Apache-2.0 fingerprint: README.md: bafybeign56hilwuoa6bgos3uqabss4gew4vadkik7vhj3ucpqw6nxtqtpe fingerprint_ignore_patterns: [] -agent: valory/impact_evaluator:0.1.0:bafybeiahkygqtth6nmhg6qg4bnlxkb5gcbcercadw43fpbxaicowghbg7q +agent: valory/impact_evaluator:0.1.0:bafybeibu43hbpldh6xhgrv5f2gp3cougpbwsforvqwgh6khklla6s6upfu number_of_agents: 4 deployment: agent: diff --git a/packages/valory/services/impact_evaluator_local/service.yaml b/packages/valory/services/impact_evaluator_local/service.yaml index 63a9b891..5aaa3806 100644 --- a/packages/valory/services/impact_evaluator_local/service.yaml +++ b/packages/valory/services/impact_evaluator_local/service.yaml @@ -8,7 +8,7 @@ license: Apache-2.0 fingerprint: README.md: bafybeign56hilwuoa6bgos3uqabss4gew4vadkik7vhj3ucpqw6nxtqtpe fingerprint_ignore_patterns: [] -agent: valory/impact_evaluator:0.1.0:bafybeiahkygqtth6nmhg6qg4bnlxkb5gcbcercadw43fpbxaicowghbg7q +agent: valory/impact_evaluator:0.1.0:bafybeibu43hbpldh6xhgrv5f2gp3cougpbwsforvqwgh6khklla6s6upfu number_of_agents: 1 deployment: agent: diff --git a/packages/valory/skills/impact_evaluator_abci/skill.yaml b/packages/valory/skills/impact_evaluator_abci/skill.yaml index 91b9bbd5..e823efe6 100644 --- a/packages/valory/skills/impact_evaluator_abci/skill.yaml +++ b/packages/valory/skills/impact_evaluator_abci/skill.yaml @@ -26,7 +26,7 @@ skills: - valory/abstract_round_abci:0.1.0:bafybeibiw4oqwqvo4jccwz5fb73iardzychgvcl66tceiildohoju2ikti - valory/ceramic_read_abci:0.1.0:bafybeigz7rzfls3niv3urfb4z4vwr525ooxveelgg3djpvkg5jzetxlm2u - valory/generic_scoring_abci:0.1.0:bafybeif46mwn3oxfqu7i5tg6trce3t7koa3vmbrub47ffz7gcr5p6qlvri -- valory/twitter_scoring_abci:0.1.0:bafybeidqaj3j73v73f725ubv6vecfrvvmmxpfyzm6oro7rmnmslxaaq65e +- valory/twitter_scoring_abci:0.1.0:bafybeig62izsraoluo7kai7te2pcwgy7utbxldklawpw3itwhyyvwelifq - valory/ceramic_write_abci:0.1.0:bafybeic6c3iub3nsr5tmr7g5vzoixbin6w64ewudfiq6u4r2fiqwbg753i - valory/dynamic_nft_abci:0.1.0:bafybeidrfsjm75ixwhud4vrxaswj7rlviervh2waquafedrcr2mipts26y - valory/registration_abci:0.1.0:bafybeib3n6vqkfbrcubcbliebjnuwyywdinxkbzt76n6gbn2kg7ace47dq diff --git a/packages/valory/skills/twitter_scoring_abci/behaviours.py b/packages/valory/skills/twitter_scoring_abci/behaviours.py index 8345e41d..ff758390 100644 --- a/packages/valory/skills/twitter_scoring_abci/behaviours.py +++ b/packages/valory/skills/twitter_scoring_abci/behaviours.py @@ -1134,17 +1134,18 @@ def get_update_diff(self) -> Generator[None, None, Dict]: current_period_points += new_points # Get the user staking contract and epoch (if the user is staked) - service_multisig = user.get("service_multisig", None) epoch = None - if service_multisig and user.get("wallet_address", None): - staking_contract_address = yield from self.get_staking_contract( - user["wallet_address"] - ) - epoch = ( - staking_contract_to_epoch[staking_contract_address] - if staking_contract_address - else None - ) + if user: + service_multisig = user.get("service_multisig", None) + if service_multisig and user.get("wallet_address", None): + staking_contract_address = yield from self.get_staking_contract( + user["wallet_address"] + ) + epoch = ( + staking_contract_to_epoch[staking_contract_address] + if staking_contract_address + else None + ) # Store the tweet id and awarded points user_tweets = {} if not user else user.get("tweets", {}) diff --git a/packages/valory/skills/twitter_scoring_abci/skill.yaml b/packages/valory/skills/twitter_scoring_abci/skill.yaml index b6d3009c..0a2cb5dd 100644 --- a/packages/valory/skills/twitter_scoring_abci/skill.yaml +++ b/packages/valory/skills/twitter_scoring_abci/skill.yaml @@ -8,7 +8,7 @@ license: Apache-2.0 aea_version: '>=1.0.0, <2.0.0' fingerprint: __init__.py: bafybeifudgakkjoyahuewp2o4gvqayw7nsgpyxw2ayrpgmzexurh2xomaq - behaviours.py: bafybeicmuc6vqundgmwg3kge6urnhg4yoejiled3tgtjsp7lzdgfy3mlc4 + behaviours.py: bafybeibqztwvj6ku5f5q4cf3hmloeeci6ied6dejjtdfsjepw5k62wdtjq dialogues.py: bafybeibdqzn37hbo2cq4skww4uh2zvvsjyaxxvdhxisefbdvmjp7rh53si fsm_specification.yaml: bafybeihbq2olrdqx2x5lcvypxyi44ecog4nntsvw2v6oeab4imvj5nz6ae handlers.py: bafybeid3nqvcyotqj5g5hlgrz57nf7vpjysmgvsxe3p7644f4z5dcwqn6u