Skip to content

Commit

Permalink
Merge pull request #227 from valory-xyz/fix/points
Browse files Browse the repository at this point in the history
Fix/points
  • Loading branch information
dvilelaf authored Nov 13, 2024
2 parents fe1eb4a + d7e718f commit fd7ae70
Show file tree
Hide file tree
Showing 16 changed files with 53 additions and 45 deletions.
4 changes: 2 additions & 2 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:bafybeihbdws7fzicgmbvvrnwbaeuznqve7n7njt3nmcmznrynlcr7y5whq --service
autonomy fetch valory/impact_evaluator:0.1.0:bafybeihelzs5bn7o2c5kz3eotw5g2ga77laen3l2ohonb455b7uvqib74e --service
```

3. Build the Docker image of the service agents
Expand Down Expand Up @@ -93,7 +93,7 @@ In order to run a local demo service based on the IEKit:
EARLIEST_BLOCK_TO_MONITOR=16097553
RESET_TENDERMINT_AFTER=5
TWITTER_SEARCH_ARGS=query=%23OlasNetwork&tweet.fields=author_id,created_at,conversation_id&user.fields=name&expansions=author_id&max_results=100&since_id={since_id}
MAX_POINTS_PER_PERIOD=5000
MAX_POINTS_PER_PERIOD=1000
USE_ACN=false
TWITTER_TWEETS_ARGS=tweet.fields=author_id,created_at,conversation_id,public_metrics&user.fields=name&expansions=author_id&max_results=10&start_time={start_time}
DEFAULT_CHAIN_ID=gnosis
Expand Down
14 changes: 7 additions & 7 deletions packages/packages.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,23 +15,23 @@
"connection/valory/openai/0.1.0": "bafybeifz2n6s6u3zvvryhhxpkvn6guyp2jwpagtyjducvgwoldtmz7ea64",
"connection/valory/farcaster/0.1.0": "bafybeibbdas7lxbipksodaphjms3uop7vnzjqkroktjq2g6wbvgtlldaxi",
"skill/valory/dynamic_nft_abci/0.1.0": "bafybeic7w6vqpt6rqlw6t7opzm3px2gwb6doo2a6etyyqueez24mbrcqqy",
"skill/valory/twitter_scoring_abci/0.1.0": "bafybeier6oydc5saiyt2e47moz3n54degmlq2ekcifeagc4ggfcj6aemna",
"skill/valory/twitter_scoring_abci/0.1.0": "bafybeibwbxtdz6ypba4vpkxg4esqs3f5ug5ljlwza7njyccoyzmx37dpdu",
"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": "bafybeiblxwctj3dzgpn5ev6jpfcm73cdrwhjxetl35sjsyy5hpecbcmozi",
"skill/valory/impact_evaluator_abci/0.1.0": "bafybeicc4cvshbkhcuaevonh3drpw5iqzsnvdnntiwkogu7x6oeufmy2dy",
"skill/valory/generic_scoring_abci/0.1.0": "bafybeiffup7abnyqjinsakjawzwr6t6pp32joiuoz4gara7jm7tlfo725q",
"skill/valory/twitter_write_abci/0.1.0": "bafybeibp7zai2qwvfjd5fgpayx44x5c2zshbukpobvz2la7ws2l5f5fjde",
"skill/valory/llm_abci/0.1.0": "bafybeib2k62hilwglfad33bzxkjlviw5bxwiw7z3rjvweyeamatdjznpeq",
"skill/valory/decision_making_abci/0.1.0": "bafybeidj3owli2etpxxfgpfevqis7mtlxmnujsrfqw3pwfq6zvfc5rhfy4",
"skill/valory/olas_week_abci/0.1.0": "bafybeihtfb7c6m5ncznftfiww62pjwi3w2mkpzbjdwry5mf5msh5szzjt4",
"skill/valory/mech_interact_abci/0.1.0": "bafybeibzhywzwowfmebf4o2bppyjupdpjkdsawceetam4ac3lmh5yp22xy",
"skill/valory/olas_week_abci/0.1.0": "bafybeihsnuymbv3wb6yvmbxegd5usctbzakfz27255lnvxlhncxsu3s7xi",
"skill/valory/mech_interact_abci/0.1.0": "bafybeicpskytv7osu6bdpmcweemlsb4f3m6gldzpyoxgawkczsmvlrzgma",
"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": "bafybeicno3rvvk6racd3ounebvhh5vcghbnbgjkdqqdj633nuwarkchfou",
"agent/valory/impact_evaluator/0.1.0": "bafybeiekj2zd5wcqq7kzqw5ymi626wekpnrjzjsadj7bi3g2rnz32mdaku",
"agent/valory/farcaster_test/0.1.0": "bafybeiefui6dnhhy5leqyvfrbkeleb64gap5tzctkrzzggjf4ubbxamjvy",
"service/valory/impact_evaluator/0.1.0": "bafybeihbdws7fzicgmbvvrnwbaeuznqve7n7njt3nmcmznrynlcr7y5whq",
"service/valory/impact_evaluator_local/0.1.0": "bafybeidnu46oftf25amc54lc4glx27pih62xq5xc4xii66ga62njli74fa"
"service/valory/impact_evaluator/0.1.0": "bafybeihelzs5bn7o2c5kz3eotw5g2ga77laen3l2ohonb455b7uvqib74e",
"service/valory/impact_evaluator_local/0.1.0": "bafybeihadh3gm5ouff4mgql5scregpniw7ovavmwvacaujqoix5ktghwnq"
},
"third_party": {
"protocol/open_aea/signing/1.0.0": "bafybeihv62fim3wl2bayavfcg3u5e5cxu3b7brtu4cn5xoxd6lqwachasi",
Expand Down
10 changes: 5 additions & 5 deletions packages/valory/agents/impact_evaluator/aea-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:bafybeiblxwctj3dzgpn5ev6jpfcm73cdrwhjxetl35sjsyy5hpecbcmozi
- valory/impact_evaluator_abci:0.1.0:bafybeicc4cvshbkhcuaevonh3drpw5iqzsnvdnntiwkogu7x6oeufmy2dy
- valory/generic_scoring_abci:0.1.0:bafybeiffup7abnyqjinsakjawzwr6t6pp32joiuoz4gara7jm7tlfo725q
- valory/twitter_scoring_abci:0.1.0:bafybeier6oydc5saiyt2e47moz3n54degmlq2ekcifeagc4ggfcj6aemna
- valory/twitter_scoring_abci:0.1.0:bafybeibwbxtdz6ypba4vpkxg4esqs3f5ug5ljlwza7njyccoyzmx37dpdu
- valory/ceramic_read_abci:0.1.0:bafybeigz7rzfls3niv3urfb4z4vwr525ooxveelgg3djpvkg5jzetxlm2u
- valory/ceramic_write_abci:0.1.0:bafybeic6c3iub3nsr5tmr7g5vzoixbin6w64ewudfiq6u4r2fiqwbg753i
- valory/dynamic_nft_abci:0.1.0:bafybeic7w6vqpt6rqlw6t7opzm3px2gwb6doo2a6etyyqueez24mbrcqqy
Expand All @@ -58,8 +58,8 @@ skills:
- valory/twitter_write_abci:0.1.0:bafybeibp7zai2qwvfjd5fgpayx44x5c2zshbukpobvz2la7ws2l5f5fjde
- valory/decision_making_abci:0.1.0:bafybeidj3owli2etpxxfgpfevqis7mtlxmnujsrfqw3pwfq6zvfc5rhfy4
- valory/llm_abci:0.1.0:bafybeib2k62hilwglfad33bzxkjlviw5bxwiw7z3rjvweyeamatdjznpeq
- valory/olas_week_abci:0.1.0:bafybeihtfb7c6m5ncznftfiww62pjwi3w2mkpzbjdwry5mf5msh5szzjt4
- valory/mech_interact_abci:0.1.0:bafybeibzhywzwowfmebf4o2bppyjupdpjkdsawceetam4ac3lmh5yp22xy
- valory/olas_week_abci:0.1.0:bafybeihsnuymbv3wb6yvmbxegd5usctbzakfz27255lnvxlhncxsu3s7xi
- valory/mech_interact_abci:0.1.0:bafybeicpskytv7osu6bdpmcweemlsb4f3m6gldzpyoxgawkczsmvlrzgma
- valory/staking_abci:0.1.0:bafybeieutg3epfnqtaucw6rpkq7vzzt5pkziqt4zlpjmispz2gqzth45ay
default_ledger: ethereum
required_ledgers:
Expand Down Expand Up @@ -267,7 +267,7 @@ models:
finalize_timeout: 60.0
history_check_timeout: 1205
centaur_id_to_secrets: ${str:{}}
max_points_per_period: ${int:5000}
max_points_per_period: ${int:1000}
use_slashing: ${bool:false}
slash_cooldown_hours: ${int:3}
slash_threshold_amount: ${int:10000000000000000}
Expand Down
10 changes: 5 additions & 5 deletions packages/valory/services/impact_evaluator/service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ license: Apache-2.0
fingerprint:
README.md: bafybeign56hilwuoa6bgos3uqabss4gew4vadkik7vhj3ucpqw6nxtqtpe
fingerprint_ignore_patterns: []
agent: valory/impact_evaluator:0.1.0:bafybeicno3rvvk6racd3ounebvhh5vcghbnbgjkdqqdj633nuwarkchfou
agent: valory/impact_evaluator:0.1.0:bafybeiekj2zd5wcqq7kzqw5ymi626wekpnrjzjsadj7bi3g2rnz32mdaku
number_of_agents: 4
deployment:
agent:
Expand Down Expand Up @@ -112,7 +112,7 @@ extra:
use_termination: ${USE_TERMINATION:bool:true}
validate_timeout: 1205
centaur_id_to_secrets: ${CENTAUR_ID_TO_SECRETS:str:{}}
max_points_per_period: ${MAX_POINTS_PER_PERIOD:int:900}
max_points_per_period: ${MAX_POINTS_PER_PERIOD:int:1000}
openai_call_window_size: ${OPENAI_CALL_WINDOW_SIZE:float:3600.0}
openai_calls_allowed_in_window: ${OPENAI_CALLS_ALLOWED_IN_WINDOW:int:100}
service_endpoint_base: ${SERVICE_ENDPOINT_BASE:str:https://dummy_service.autonolas.tech/}
Expand Down Expand Up @@ -208,7 +208,7 @@ extra:
use_termination: ${USE_TERMINATION:bool:true}
validate_timeout: 1205
centaur_id_to_secrets: ${CENTAUR_ID_TO_SECRETS:str:{}}
max_points_per_period: ${MAX_POINTS_PER_PERIOD:int:900}
max_points_per_period: ${MAX_POINTS_PER_PERIOD:int:1000}
openai_call_window_size: ${OPENAI_CALL_WINDOW_SIZE:float:3600.0}
openai_calls_allowed_in_window: ${OPENAI_CALLS_ALLOWED_IN_WINDOW:int:100}
service_endpoint_base: ${SERVICE_ENDPOINT_BASE:str:https://dummy_service.autonolas.tech/}
Expand Down Expand Up @@ -304,7 +304,7 @@ extra:
use_termination: ${USE_TERMINATION:bool:true}
validate_timeout: 1205
centaur_id_to_secrets: ${CENTAUR_ID_TO_SECRETS:str:{}}
max_points_per_period: ${MAX_POINTS_PER_PERIOD:int:900}
max_points_per_period: ${MAX_POINTS_PER_PERIOD:int:1000}
openai_call_window_size: ${OPENAI_CALL_WINDOW_SIZE:float:3600.0}
openai_calls_allowed_in_window: ${OPENAI_CALLS_ALLOWED_IN_WINDOW:int:100}
service_endpoint_base: ${SERVICE_ENDPOINT_BASE:str:https://dummy_service.autonolas.tech/}
Expand Down Expand Up @@ -404,7 +404,7 @@ extra:
finalize_timeout: 60.0
history_check_timeout: 1205
centaur_id_to_secrets: ${CENTAUR_ID_TO_SECRETS:str:{}}
max_points_per_period: ${MAX_POINTS_PER_PERIOD:int:900}
max_points_per_period: ${MAX_POINTS_PER_PERIOD:int:1000}
openai_call_window_size: ${OPENAI_CALL_WINDOW_SIZE:float:3600.0}
openai_calls_allowed_in_window: ${OPENAI_CALLS_ALLOWED_IN_WINDOW:int:100}
service_endpoint_base: ${SERVICE_ENDPOINT_BASE:str:https://dummy_service.autonolas.tech/}
Expand Down
4 changes: 2 additions & 2 deletions packages/valory/services/impact_evaluator_local/service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ license: Apache-2.0
fingerprint:
README.md: bafybeign56hilwuoa6bgos3uqabss4gew4vadkik7vhj3ucpqw6nxtqtpe
fingerprint_ignore_patterns: []
agent: valory/impact_evaluator:0.1.0:bafybeicno3rvvk6racd3ounebvhh5vcghbnbgjkdqqdj633nuwarkchfou
agent: valory/impact_evaluator:0.1.0:bafybeiekj2zd5wcqq7kzqw5ymi626wekpnrjzjsadj7bi3g2rnz32mdaku
number_of_agents: 1
deployment:
agent:
Expand Down Expand Up @@ -111,7 +111,7 @@ models:
use_termination: ${USE_TERMINATION:bool:true}
validate_timeout: 1205
centaur_id_to_secrets: ${CENTAUR_ID_TO_SECRETS:str:{}}
max_points_per_period: ${MAX_POINTS_PER_PERIOD:int:5000}
max_points_per_period: ${MAX_POINTS_PER_PERIOD:int:1000}
openai_call_window_size: ${OPENAI_CALL_WINDOW_SIZE:float:3600.0}
openai_calls_allowed_in_window: ${OPENAI_CALLS_ALLOWED_IN_WINDOW:int:100}
service_endpoint_base: ${SERVICE_ENDPOINT_BASE:str:https://dummy_service.autonolas.tech/}
Expand Down
8 changes: 4 additions & 4 deletions packages/valory/skills/impact_evaluator_abci/skill.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:bafybeiffup7abnyqjinsakjawzwr6t6pp32joiuoz4gara7jm7tlfo725q
- valory/twitter_scoring_abci:0.1.0:bafybeier6oydc5saiyt2e47moz3n54degmlq2ekcifeagc4ggfcj6aemna
- valory/twitter_scoring_abci:0.1.0:bafybeibwbxtdz6ypba4vpkxg4esqs3f5ug5ljlwza7njyccoyzmx37dpdu
- valory/ceramic_write_abci:0.1.0:bafybeic6c3iub3nsr5tmr7g5vzoixbin6w64ewudfiq6u4r2fiqwbg753i
- valory/dynamic_nft_abci:0.1.0:bafybeic7w6vqpt6rqlw6t7opzm3px2gwb6doo2a6etyyqueez24mbrcqqy
- valory/registration_abci:0.1.0:bafybeib3n6vqkfbrcubcbliebjnuwyywdinxkbzt76n6gbn2kg7ace47dq
Expand All @@ -36,8 +36,8 @@ skills:
- valory/decision_making_abci:0.1.0:bafybeidj3owli2etpxxfgpfevqis7mtlxmnujsrfqw3pwfq6zvfc5rhfy4
- valory/llm_abci:0.1.0:bafybeib2k62hilwglfad33bzxkjlviw5bxwiw7z3rjvweyeamatdjznpeq
- valory/twitter_write_abci:0.1.0:bafybeibp7zai2qwvfjd5fgpayx44x5c2zshbukpobvz2la7ws2l5f5fjde
- valory/olas_week_abci:0.1.0:bafybeihtfb7c6m5ncznftfiww62pjwi3w2mkpzbjdwry5mf5msh5szzjt4
- valory/mech_interact_abci:0.1.0:bafybeibzhywzwowfmebf4o2bppyjupdpjkdsawceetam4ac3lmh5yp22xy
- valory/olas_week_abci:0.1.0:bafybeihsnuymbv3wb6yvmbxegd5usctbzakfz27255lnvxlhncxsu3s7xi
- valory/mech_interact_abci:0.1.0:bafybeicpskytv7osu6bdpmcweemlsb4f3m6gldzpyoxgawkczsmvlrzgma
- valory/staking_abci:0.1.0:bafybeieutg3epfnqtaucw6rpkq7vzzt5pkziqt4zlpjmispz2gqzth45ay
behaviours:
main:
Expand Down Expand Up @@ -176,7 +176,7 @@ models:
twitter_tweets_args: tweet.fields=author_id,created_at,conversation_id,public_metrics&user.fields=name&expansions=author_id&max_results=50&start_time={start_time}
openai_call_window_size: 3600.0
openai_calls_allowed_in_window: 100
max_points_per_period: 5000
max_points_per_period: 1000
tx_timeout: 10.0
whitelist_api_key: null
whitelist_endpoint: http://localhost
Expand Down
10 changes: 5 additions & 5 deletions packages/valory/skills/mech_interact_abci/behaviours/request.py
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ def _get_wrapped_native_balance(

def update_safe_balances(self) -> WaitableConditionType:
"""Check the safe's balance."""
account = self.params.safe_contract_address_gnosis
account = self.synchronized_data.safe_contract_address
wallet = yield from self._get_native_balance(account)
if wallet is None:
return False
Expand Down Expand Up @@ -328,11 +328,11 @@ def _build_multisend_data(
def _build_multisend_safe_tx_hash(self) -> WaitableConditionType:
"""Prepares and returns the safe tx hash for a multisend tx."""
self.context.logger.info(
f"Building multisend safe tx hash: safe={self.params.safe_contract_address_gnosis}"
f"Building multisend safe tx hash: safe={self.synchronized_data.safe_contract_address}"
)
response_msg = yield from self.get_contract_api_response(
performative=ContractApiMessage.Performative.GET_STATE, # type: ignore
contract_address=self.params.safe_contract_address_gnosis,
contract_address=self.synchronized_data.safe_contract_address,
contract_id=str(GnosisSafeContract.contract_id),
contract_callable="get_raw_safe_transaction_hash",
to_address=self.params.multisend_address,
Expand Down Expand Up @@ -475,7 +475,7 @@ def async_act(self) -> Generator:
None,
None,
self.params.mech_chain_id,
self.params.safe_contract_address_gnosis,
self.synchronized_data.safe_contract_address,
None,
None,
)
Expand All @@ -497,7 +497,7 @@ def async_act(self) -> Generator:
self.tx_hex,
self.price,
self.params.mech_chain_id,
self.params.safe_contract_address_gnosis,
self.synchronized_data.safe_contract_address,
*serialized_data,
)
yield from self.finish_behaviour(payload)
3 changes: 0 additions & 3 deletions packages/valory/skills/mech_interact_abci/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,9 +112,6 @@ def __init__(self, *args: Any, **kwargs: Any) -> None:
== self.mech_marketplace_config.priority_mech_address,
"The mech contract address must be the same as the priority mech address when using the marketplace.",
)
self.safe_contract_address_gnosis: str = self._ensure(
"safe_contract_address_gnosis", kwargs, str
)
super().__init__(*args, **kwargs)

@property
Expand Down
5 changes: 2 additions & 3 deletions packages/valory/skills/mech_interact_abci/skill.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@ fingerprint:
__init__.py: bafybeidf3nlv5fpvfy4libtscayhirdw64shgmhfmvjiftjmjkmhu7auxq
behaviours/__init__.py: bafybeie3zsi6p3yanz5mqwpkdrcgywaqvkit3hdintsb4awnvalgxpxa4i
behaviours/base.py: bafybeif4dvt4p5wfh6q3ybqwnzy62lbr3vqy322sr3wm6pkcrha2ggin6q
behaviours/request.py: bafybeidl25lhusageykea2u4lktjr3cqhj2jox3eo4t4nhor7hbi3h7bdq
behaviours/request.py: bafybeic7nul5iawujburikfdr544g23gxto2wb3jqs4it3kpqffp3fdgrq
behaviours/response.py: bafybeibigqdtdxxzufx7cclzjrafszg2lb6y5ommp3jzbyoit735wtm7tq
behaviours/round_behaviour.py: bafybeib33inrpyzzlx7k7i3okkslsx4p46dgdaww2m5k7rno57o5nndage
dialogues.py: bafybeigjmyzd2bx6mgqiet2c223k6wkc5jk7kdkstbhpaxlqxatey26tlm
fsm_specification.yaml: bafybeiapzwz6zcneelc2b2wrcb7cae7x6vbthmf6a57cm4mv6hucp67lz4
handlers.py: bafybeiduy2nwkqdynainuimkjulcv7u2qq6iglkuut3gfurkckydapitg4
models.py: bafybeihywx7wdzil4uuqsg5sllsary7nzpaimzq7742bledoanl3wmx5wi
models.py: bafybeidfes4ovzsyntxvqtx55qi2tznmllhzznf5qmozi52zrukiyrtbni
payloads.py: bafybeie3s5irdmcggst5kmbm6duyhr4nm2qc67fkwznhrdskri4qzmkmla
rounds.py: bafybeif7taciv6pqupb7xuewurqssziplbjeobbv4d7ea3vbngz3kpjnee
states/__init__.py: bafybeie34wx5znr2hxwh3gs2fchmbeuzjcfnraymdvtzjaxaq5zsiw233q
Expand Down Expand Up @@ -147,7 +147,6 @@ models:
validate_timeout: 1205
multisend_batch_size: 50
mech_contract_address: '0x77af31De935740567Cf4fF1986D04B2c964A786a'
safe_contract_address_gnosis: '0x0000000000000000000000000000000000000000'
mech_request_price: null
mech_chain_id: gnosis
mech_wrapped_native_token_address: '0xe91D153E0b41518A2Ce8Dd3D7944Fa863463a97d'
Expand Down
1 change: 0 additions & 1 deletion packages/valory/skills/olas_week_abci/skill.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,6 @@ models:
max_tweet_pulls_allowed: 80
openai_call_window_size: 3600.0
openai_calls_allowed_in_window: 100
max_points_per_period: 5000
validate_timeout: 1205
use_termination: false
use_slashing: false
Expand Down
7 changes: 6 additions & 1 deletion packages/valory/skills/twitter_scoring_abci/behaviours.py
Original file line number Diff line number Diff line change
Expand Up @@ -1029,11 +1029,16 @@ def async_act(self) -> Generator:
"Evaluation data is not valid: key not valid"
)
else:
points = 100 * (
# Tweet quality, relationship and engagement go from 1 to 3.
# When we add the three of them, the total value goes from 3 to 9.
# We want to scale that value up so it goes from 1 to 10.
# (S - 3) / (9 - 3) = (X - 1) / (10 - 1) -> X = (3S - 7) / 2
S = (
TWEET_QUALITY_TO_POINTS[quality]
+ TWEET_RELATIONSHIP_TO_POINTS[relationship]
+ engagement
)
points = 1.5 * S - 3.5
except Exception as e:
self.context.logger.error(
f"Evaluation data is not valid: exception {e}"
Expand Down
1 change: 1 addition & 0 deletions packages/valory/skills/twitter_scoring_abci/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None:
)
self.staking_contract_addresses = kwargs.get("staking_contract_addresses", [])
self.contributors_contract_address = kwargs.get("contributors_contract_address")
self.safe_contract_address_gnosis = kwargs.get("safe_contract_address_gnosis")
super().__init__(*args, **kwargs)


Expand Down
5 changes: 5 additions & 0 deletions packages/valory/skills/twitter_scoring_abci/rounds.py
Original file line number Diff line number Diff line change
Expand Up @@ -537,6 +537,11 @@ def end_block(self) -> Optional[Tuple[BaseSynchronizedData, Enum]]:
get_name(
SynchronizedData.performed_twitter_tasks
): performed_twitter_tasks,
# Overwrite safe address with the gnosis one before
# a mech request
get_name(
SynchronizedData.safe_contract_address
): self.context.params.safe_contract_address_gnosis,
},
)
return synchronized_data, Event.DONE
Expand Down
Loading

0 comments on commit fd7ae70

Please sign in to comment.