I'm trying to create a function that can set an address to a struct so that I can enter that address and get the struct data returned to me. I.e. 0x876... returns name "John", balance "99"
I get an error message on 'getInfoByWallet[_wall] = teamWallets;' that says
"from solidity: mapping.sol:22:34: TypeError: Type type(struct Mapping.teamWallets storage pointer) is not implicitly convertible to expected type struct Mapping.teamWallets storage ref. getInfoByWallet[_wall] = teamWallets;"
Im pretty confused and not really sure what to do. Any help is much appreciated.
pragma solidity ^0.5.11;
pragma experimental ABIEncoderV2;
contract Mapping {
struct teamWallets {
string name;
uint256 balance;
}
string name = "";
uint256 balance = 0;
teamWallets[] public _teamWallets;
mapping(address => teamWallets) public getInfoByWallet;
function addteamData(string memory _name, uint256 _balance) public {
_teamWallets.push(teamWallets(_name, _balance));
}
function setInfo(address _wall, teamWallets memory) public {
getInfoByWallet[_wall] = teamWallets;
}
}