Pass string[] to function

Hi!
Giving this signature:
address, string calldata, string calldata

I’m trying to pass parameters as:
w3.toChecksumAddress(address), [“val1”, “val2”], [“val3”, “val4”]

But it fails as detects:
(<class ‘str’>, <class ‘list’>, <class ‘list’>)
instead of:
(address,string,string)

Is this library updated to support string?
or
am I doing something wrong? How should I pass those params?

Thanks

Can you post your code in the entirety.

string is an array.

But it is trying to see it as a list in your other application? Does it understand that?

The rest of the code should be irrelevant
My question is about how web3py is converting python native types List[str] to string and, perhaps, w3.toChecksumAddress(address) to address (since it understand str instead of address)
I know that string has been introduced recently so the most logical conclusion is that web3py doesn’t support yet or good enough this new type
Which means that perhaps the conversion should be made manually until web3py catches up

Am I right?
How would the manual conversion be?
Is the address being an issue too?

BTW: thanks for your interest

I don’t use web3py, so this may be more of a question from them. I think most of us here are javascript and solidity based. I’m sorry I can’t be of more help.

I think it’s fine if you use the toChecksumAddress so that probably works.

I think the heart of the issue is as you say, how the conversion between types are done. I’ve looked up some links on how to solve this issue.

https://web3py.readthedocs.io/en/stable/index.html

I’ve posted another similar issue in the web3py’s github
Thanks for your references but, as I mention, string has been recently introduced so those post are very outdated
In general, this space is full of outdated information, no wonder why no more people is participating in it (which is a good opportunity for us, I guess)

1 Like