-
Notifications
You must be signed in to change notification settings - Fork 240
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Sample Updates #690
Sample Updates #690
Conversation
Added contract call and private key sign/send to the UnsortedSample.cs file. Removed some magic strings and changed them to input parameters in UnsortedSample.cs. Updated tests.
@@ -8,6 +8,10 @@ public class ContractSendBehaviour : SampleBehaviour | |||
public string method = "addTotal"; | |||
public string abi = "[ { \"inputs\": [ { \"internalType\": \"uint8\", \"name\": \"_myArg\", \"type\": \"uint8\" } ], \"name\": \"addTotal\", \"outputs\": [], \"stateMutability\": \"nonpayable\", \"type\": \"function\" }, { \"inputs\": [], \"name\": \"myTotal\", \"outputs\": [ { \"internalType\": \"uint256\", \"name\": \"\", \"type\": \"uint256\" } ], \"stateMutability\": \"view\", \"type\": \"function\" } ]"; | |||
public string contractAddress = "0x7286Cf0F6E80014ea75Dbc25F545A3be90F4904F"; | |||
public object[] args = | |||
{ | |||
1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What does that number 1 actually represent?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The amount to increase the state variable by like so:
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.19;
contract AddTotal {
uint256 public myTotal = 0;
function addTotal(uint8 _myArg) public {
myTotal = myTotal + _myArg;
}
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I should probably refactor the object so it's initialized from a public integer so it's not sitting there as a magic number too. BRB.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I get the following build error:
/Users/juanmanuelspoleti/Desktop/workspace/web3.unity/Packages/io.chainsafe.web3-unity.web3auth/Runtime/Web3AuthWalletExtensions.cs(50,100): error CS1026: ) expected
@juans-chainsafe Theres a fix in @sneakzttv latest goerli PR that is approved that should resolve that issue |
should work now @juans-chainsafe |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Samples working correctly!
* Sample Updates Added contract call and private key sign/send to the UnsortedSample.cs file. Removed some magic strings and changed them to input parameters in UnsortedSample.cs. Updated tests. * Auto-duplicate Package Samples * Update ContractSendBehaviour.cs * Auto-duplicate Package Samples * Test case Updated test case to use a constant instead of a magic number --------- Co-authored-by: sneakzttv <sneakzttv@users.noreply.github.com>
* Sample Updates Added contract call and private key sign/send to the UnsortedSample.cs file. Removed some magic strings and changed them to input parameters in UnsortedSample.cs. Updated tests. * Auto-duplicate Package Samples * Update ContractSendBehaviour.cs * Auto-duplicate Package Samples * Test case Updated test case to use a constant instead of a magic number --------- Co-authored-by: sneakzttv <sneakzttv@users.noreply.github.com>
Added contract call and private key sign/send to the UnsortedSample.cs file for ECDSA later.
Removed some magic strings and changed them to input parameters in UnsortedSample.cs.
Updated tests.