Skip to content
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

feat(contracts): cheng test contracts #51

Merged
merged 1 commit into from
Nov 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion msg/handler/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ func (r *Handler) asyncHandle(m *msg.Msg) {
return
}
slog.Debug("writing proof to chain")
txHash, err := eth.SendTX(context.Background(), r.chainEndpoint, r.operatorPrivateKey, "0x190Cc9af23504ac5Dc461376C1e2319bc3B9cD29", data)
txHash, err := eth.SendTX(context.Background(), r.chainEndpoint, r.operatorPrivateKey, "0xbc3c770272a8d274ba75ce2a104df397f7ca793e", data)
if err != nil {
slog.Error(err.Error())
return
Expand Down
33 changes: 32 additions & 1 deletion test/contract/Store.abi
Original file line number Diff line number Diff line change
@@ -1 +1,32 @@
[{"constant":true,"inputs":[],"name":"getProof","outputs":[{"internalType":"string","name":"","type":"string"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"internalType":"string","name":"_proof","type":"string"}],"name":"setProof","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"}]
[
{
"constant": true,
"inputs": [],
"name": "getProof",
"outputs": [
{
"internalType": "bytes",
"name": "",
"type": "bytes"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": false,
"inputs": [
{
"internalType": "bytes",
"name": "_proof",
"type": "bytes"
}
],
"name": "setProof",
"outputs": [],
"payable": false,
"stateMutability": "nonpayable",
"type": "function"
}
]
6 changes: 3 additions & 3 deletions test/contract/Store.sol
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
pragma solidity ^0.5.0;

contract Store {
string private proof;
bytes private proof;

function setProof(string memory _proof) public {
function setProof(bytes memory _proof) public {
proof = _proof;
}

function getProof() public view returns (string memory){
function getProof() public view returns (bytes memory){
return proof;
}
}
2 changes: 1 addition & 1 deletion test/contract/data.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,5 @@ func BuildData(param []byte) ([]byte, error) {
if err != nil {
return nil, err
}
return storeABI.Pack("setProof", string(param))
return storeABI.Pack("setProof", param)
}