Skip to content

Commit

Permalink
Merge pull request #224 from valory-xyz/fix/safe
Browse files Browse the repository at this point in the history
Fix/safe
  • Loading branch information
dvilelaf authored Nov 12, 2024
2 parents 36b988a + 8095333 commit b70b85e
Show file tree
Hide file tree
Showing 10 changed files with 23 additions and 38 deletions.
2 changes: 1 addition & 1 deletion 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:bafybeib2doczuv4qoru7xxvinakmbhg73cw72mauhjek7vgi2jlngl4gvy --service
autonomy fetch valory/impact_evaluator:0.1.0:bafybeiaatoaxzqdcwawyiuxtzzmqnc6hhsp2ugvoukrrutijgp6pu53lee --service
```

3. Build the Docker image of the service agents
Expand Down
12 changes: 6 additions & 6 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": "bafybeidrfsjm75ixwhud4vrxaswj7rlviervh2waquafedrcr2mipts26y",
"skill/valory/twitter_scoring_abci/0.1.0": "bafybeig62izsraoluo7kai7te2pcwgy7utbxldklawpw3itwhyyvwelifq",
"skill/valory/twitter_scoring_abci/0.1.0": "bafybeiaz3lsgcsddwutzflnc54laumwdppch7t7ipdsg3cw6ij3ftcaqvm",
"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": "bafybeiexhxom7fp7t3mbvrtnlgo5r45dnap2b4jnwkt56p37dyikdyi74q",
"skill/valory/impact_evaluator_abci/0.1.0": "bafybeibdvcfqahcitab2w6jxdlrjzgkrel6yvh2igffpwwgmgvup2uvjzy",
"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",
"skill/valory/decision_making_abci/0.1.0": "bafybeif4kh36c2urn4nkaxwysmfe6bm6wdhnbmrsmbzsmo7kpaaaa7ewee",
"skill/valory/olas_week_abci/0.1.0": "bafybeifpuvpiztlwfhz3dgzxbkgul7e3xrafefunzwdvehxmeebd5fz74q",
"skill/valory/mech_interact_abci/0.1.0": "bafybeidaevbuo3srnvjtjnumqn6gjkcqogj5rmvl2dcwygvvhhskba4yza",
"skill/valory/mech_interact_abci/0.1.0": "bafybeibzhywzwowfmebf4o2bppyjupdpjkdsawceetam4ac3lmh5yp22xy",
"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": "bafybeibu43hbpldh6xhgrv5f2gp3cougpbwsforvqwgh6khklla6s6upfu",
"agent/valory/impact_evaluator/0.1.0": "bafybeiddgacfal7mb73iicehtcscuyzttaqdute7purd6hbtzx3umh5skq",
"agent/valory/farcaster_test/0.1.0": "bafybeiefui6dnhhy5leqyvfrbkeleb64gap5tzctkrzzggjf4ubbxamjvy",
"service/valory/impact_evaluator/0.1.0": "bafybeib2doczuv4qoru7xxvinakmbhg73cw72mauhjek7vgi2jlngl4gvy",
"service/valory/impact_evaluator_local/0.1.0": "bafybeiexxk3qtqodnoflpaczdy7lhpofm3b7vxqurvdpsn4ivblxv3qlta"
"service/valory/impact_evaluator/0.1.0": "bafybeiaatoaxzqdcwawyiuxtzzmqnc6hhsp2ugvoukrrutijgp6pu53lee",
"service/valory/impact_evaluator_local/0.1.0": "bafybeiew2ggp7jbngsg6p3h7m5dysrwrpjryc4rzg4tk3tmlempwm7uxd4"
},
"third_party": {
"protocol/open_aea/signing/1.0.0": "bafybeihv62fim3wl2bayavfcg3u5e5cxu3b7brtu4cn5xoxd6lqwachasi",
Expand Down
6 changes: 3 additions & 3 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:bafybeiexhxom7fp7t3mbvrtnlgo5r45dnap2b4jnwkt56p37dyikdyi74q
- valory/impact_evaluator_abci:0.1.0:bafybeibdvcfqahcitab2w6jxdlrjzgkrel6yvh2igffpwwgmgvup2uvjzy
- valory/generic_scoring_abci:0.1.0:bafybeif46mwn3oxfqu7i5tg6trce3t7koa3vmbrub47ffz7gcr5p6qlvri
- valory/twitter_scoring_abci:0.1.0:bafybeig62izsraoluo7kai7te2pcwgy7utbxldklawpw3itwhyyvwelifq
- valory/twitter_scoring_abci:0.1.0:bafybeiaz3lsgcsddwutzflnc54laumwdppch7t7ipdsg3cw6ij3ftcaqvm
- valory/ceramic_read_abci:0.1.0:bafybeigz7rzfls3niv3urfb4z4vwr525ooxveelgg3djpvkg5jzetxlm2u
- valory/ceramic_write_abci:0.1.0:bafybeic6c3iub3nsr5tmr7g5vzoixbin6w64ewudfiq6u4r2fiqwbg753i
- valory/dynamic_nft_abci:0.1.0:bafybeidrfsjm75ixwhud4vrxaswj7rlviervh2waquafedrcr2mipts26y
Expand All @@ -59,7 +59,7 @@ skills:
- valory/decision_making_abci:0.1.0:bafybeif4kh36c2urn4nkaxwysmfe6bm6wdhnbmrsmbzsmo7kpaaaa7ewee
- valory/llm_abci:0.1.0:bafybeib2k62hilwglfad33bzxkjlviw5bxwiw7z3rjvweyeamatdjznpeq
- valory/olas_week_abci:0.1.0:bafybeifpuvpiztlwfhz3dgzxbkgul7e3xrafefunzwdvehxmeebd5fz74q
- valory/mech_interact_abci:0.1.0:bafybeidaevbuo3srnvjtjnumqn6gjkcqogj5rmvl2dcwygvvhhskba4yza
- valory/mech_interact_abci:0.1.0:bafybeibzhywzwowfmebf4o2bppyjupdpjkdsawceetam4ac3lmh5yp22xy
- valory/staking_abci:0.1.0:bafybeieutg3epfnqtaucw6rpkq7vzzt5pkziqt4zlpjmispz2gqzth45ay
default_ledger: ethereum
required_ledgers:
Expand Down
2 changes: 1 addition & 1 deletion 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:bafybeibu43hbpldh6xhgrv5f2gp3cougpbwsforvqwgh6khklla6s6upfu
agent: valory/impact_evaluator:0.1.0:bafybeiddgacfal7mb73iicehtcscuyzttaqdute7purd6hbtzx3umh5skq
number_of_agents: 4
deployment:
agent:
Expand Down
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:bafybeibu43hbpldh6xhgrv5f2gp3cougpbwsforvqwgh6khklla6s6upfu
agent: valory/impact_evaluator:0.1.0:bafybeiddgacfal7mb73iicehtcscuyzttaqdute7purd6hbtzx3umh5skq
number_of_agents: 1
deployment:
agent:
Expand Down
4 changes: 2 additions & 2 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:bafybeif46mwn3oxfqu7i5tg6trce3t7koa3vmbrub47ffz7gcr5p6qlvri
- valory/twitter_scoring_abci:0.1.0:bafybeig62izsraoluo7kai7te2pcwgy7utbxldklawpw3itwhyyvwelifq
- valory/twitter_scoring_abci:0.1.0:bafybeiaz3lsgcsddwutzflnc54laumwdppch7t7ipdsg3cw6ij3ftcaqvm
- valory/ceramic_write_abci:0.1.0:bafybeic6c3iub3nsr5tmr7g5vzoixbin6w64ewudfiq6u4r2fiqwbg753i
- valory/dynamic_nft_abci:0.1.0:bafybeidrfsjm75ixwhud4vrxaswj7rlviervh2waquafedrcr2mipts26y
- valory/registration_abci:0.1.0:bafybeib3n6vqkfbrcubcbliebjnuwyywdinxkbzt76n6gbn2kg7ace47dq
Expand All @@ -37,7 +37,7 @@ skills:
- valory/llm_abci:0.1.0:bafybeib2k62hilwglfad33bzxkjlviw5bxwiw7z3rjvweyeamatdjznpeq
- valory/twitter_write_abci:0.1.0:bafybeibp7zai2qwvfjd5fgpayx44x5c2zshbukpobvz2la7ws2l5f5fjde
- valory/olas_week_abci:0.1.0:bafybeifpuvpiztlwfhz3dgzxbkgul7e3xrafefunzwdvehxmeebd5fz74q
- valory/mech_interact_abci:0.1.0:bafybeidaevbuo3srnvjtjnumqn6gjkcqogj5rmvl2dcwygvvhhskba4yza
- valory/mech_interact_abci:0.1.0:bafybeibzhywzwowfmebf4o2bppyjupdpjkdsawceetam4ac3lmh5yp22xy
- valory/staking_abci:0.1.0:bafybeieutg3epfnqtaucw6rpkq7vzzt5pkziqt4zlpjmispz2gqzth45ay
behaviours:
main:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,7 @@ def _get_wrapped_native_balance(
contract_id=str(ERC20.contract_id),
contract_callable="check_balance",
account=account,
chain_id=self.params.mech_chain_id,
)
if response_msg.performative != ContractApiMessage.Performative.RAW_TRANSACTION:
self.context.logger.error(
Expand All @@ -221,7 +222,7 @@ def _get_wrapped_native_balance(

def update_safe_balances(self) -> WaitableConditionType:
"""Check the safe's balance."""
account = self.synchronized_data.safe_contract_address
account = self.params.safe_contract_address_gnosis
wallet = yield from self._get_native_balance(account)
if wallet is None:
return False
Expand All @@ -248,6 +249,7 @@ def _build_unwrap_tokens_tx(self) -> WaitableConditionType:
contract_id=str(ERC20.contract_id),
contract_callable="build_withdraw_tx",
amount=amount,
chain_id=self.params.mech_chain_id,
)

if response_msg.performative != ContractApiMessage.Performative.STATE:
Expand Down Expand Up @@ -326,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.synchronized_data.safe_contract_address}"
f"Building multisend safe tx hash: safe={self.params.safe_contract_address_gnosis}"
)
response_msg = yield from self.get_contract_api_response(
performative=ContractApiMessage.Performative.GET_STATE, # type: ignore
contract_address=self.synchronized_data.safe_contract_address,
contract_address=self.params.safe_contract_address_gnosis,
contract_id=str(GnosisSafeContract.contract_id),
contract_callable="get_raw_safe_transaction_hash",
to_address=self.params.multisend_address,
Expand Down
2 changes: 1 addition & 1 deletion packages/valory/skills/mech_interact_abci/skill.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ fingerprint:
__init__.py: bafybeidf3nlv5fpvfy4libtscayhirdw64shgmhfmvjiftjmjkmhu7auxq
behaviours/__init__.py: bafybeie3zsi6p3yanz5mqwpkdrcgywaqvkit3hdintsb4awnvalgxpxa4i
behaviours/base.py: bafybeif4dvt4p5wfh6q3ybqwnzy62lbr3vqy322sr3wm6pkcrha2ggin6q
behaviours/request.py: bafybeigyalxn475wm6aa7jns2jlfzyuolxtxj2wdjh7hs56zbtyo6hdetm
behaviours/request.py: bafybeidl25lhusageykea2u4lktjr3cqhj2jox3eo4t4nhor7hbi3h7bdq
behaviours/response.py: bafybeibigqdtdxxzufx7cclzjrafszg2lb6y5ommp3jzbyoit735wtm7tq
behaviours/round_behaviour.py: bafybeib33inrpyzzlx7k7i3okkslsx4p46dgdaww2m5k7rno57o5nndage
dialogues.py: bafybeigjmyzd2bx6mgqiet2c223k6wkc5jk7kdkstbhpaxlqxatey26tlm
Expand Down
4 changes: 2 additions & 2 deletions packages/valory/skills/twitter_scoring_abci/skill.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ fingerprint:
prompts.py: bafybeieiuqn427bgwfnzynxf3vtqfpvmqqscs5tyw4oibfofwropifotke
rounds.py: bafybeieklx2bx5ampjtszvg75hacxexigvlf4idsxfgwwrok77hy52f7ja
tests/__init__.py: bafybeidwzzd4ejsyf3aryd5kmrvd63h7ajgqyrxphmfaacvpjnneacejay
tests/test_behaviours.py: bafybeihio5i4sgcgj2gu2iw7udbppzgdk4gaxshqe7q5r7nveamwglqugy
tests/test_behaviours.py: bafybeidfyamtzq5ca6xw4vjbgrse5pqnfanedqs6ivddkrnctiofpgyxy4
tests/test_dialogues.py: bafybeiheyq7klonzb7rnjub2i22h7bmsnoimn2pq4j7ofikt3yovstvgt4
tests/test_handlers.py: bafybeigevirvi3saepukke2zmp334btgsdxhj55o2vawj3hqam63miirg4
tests/test_models.py: bafybeicz5jqlkgs7ffw6hdtvo6674t6uvwup5ffeqat2hvjl5yi2fttxoy
Expand All @@ -33,7 +33,7 @@ protocols:
skills:
- valory/abstract_round_abci:0.1.0:bafybeibiw4oqwqvo4jccwz5fb73iardzychgvcl66tceiildohoju2ikti
- valory/decision_making_abci:0.1.0:bafybeif4kh36c2urn4nkaxwysmfe6bm6wdhnbmrsmbzsmo7kpaaaa7ewee
- valory/mech_interact_abci:0.1.0:bafybeidaevbuo3srnvjtjnumqn6gjkcqogj5rmvl2dcwygvvhhskba4yza
- valory/mech_interact_abci:0.1.0:bafybeibzhywzwowfmebf4o2bppyjupdpjkdsawceetam4ac3lmh5yp22xy
behaviours:
main:
args: {}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1234,6 +1234,7 @@ class TestDBUpdateBehaviour(BaseBehaviourTest):
"twitter_id": "1",
"points": 0,
"wallet_address": None,
"service_multisig": None,
"token_id": None,
"discord_id": None,
}
Expand Down Expand Up @@ -1268,24 +1269,6 @@ def test_run(self, test_case: BehaviourTestCase, kwargs: Any) -> None:
),
)

# 2 tweets with wallets linked
for _ in range(2):
self.mock_contract_api_request(
request_kwargs=dict(
performative=ContractApiMessage.Performative.GET_STATE,
),
contract_id=str(Staking.contract_id),
response_kwargs=dict(
performative=ContractApiMessage.Performative.STATE,
callable="get_account_to_service_map",
state=State(
ledger_id="ethereum",
body={
"staking_contract_address": "0x95146Adf659f455f300D7521B3b62A3b6c4aBA1F"
},
),
),
)
self.complete(test_case.event)


Expand Down

0 comments on commit b70b85e

Please sign in to comment.