-
Notifications
You must be signed in to change notification settings - Fork 0
I can not use my contract ? #43
Comments
Hello @wufeiafei Are you sure that "getFlagData" method doesn't return an empty string for this msg.sender? If it does, than your result is correct, you get a default (empty) value. Regarding the "setFlagData" result: .success([:]) is a valid response if you "call" this method, since it returns nothing in your contract code. To send a transaction and mutate a state your should use a send() method of transaction intermediate Sincerely, Alex |
the "getFlagData" method return: .success(["0": ""]) |
Can you use the latest version (0.4.1) and check the logs. When returned information is decoded there are log messages, it will help to trace a problem
…________________________________
From: Kevin <[email protected]>
Sent: Sunday, April 8, 2018 5:14:43 PM
To: BANKEX/web3swift
Cc: Alexander; Comment
Subject: Re: [BANKEX/web3swift] I can not use my contract ? (#43)
the "getFlagData" method return: .success(["0": ""])
I think the result should be "hello", when I used "setFlagData" method input.
but not get.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub<#43 (comment)>, or mute the thread<https://github.com/notifications/unsubscribe-auth/AGKv98EHYRu5_urSEMmg5VbS2psl5Nywks5tmhtTgaJpZM4TLe2q>.
|
Hello @wufeiafei I've created a similar contract
and submitted some data to it using remix. Here is my response:
You can find a code in test cases in developer branch, function
|
yes, I test your code and get the"getFlagData" response like that: ["0": testData, "data": testData],when I submitted some data to it using remix. .success([:]) then, I use "getFlagData", the response is the old, not the new. |
You use mutating (not “view” and not “pure”) method “setFlagData”, so when you “call” it - you do not send a transaction, but try to call a function that returns nothing (“returns ()”).
You should instead use send() method on intermediate and that a transaction will go into network and change a value in your contract
…________________________________
From: Kevin <[email protected]>
Sent: Monday, April 9, 2018 2:01:23 PM
To: BANKEX/web3swift
Cc: Alexander; Comment
Subject: Re: [BANKEX/web3swift] I can not use my contract ? (#43)
yes, I test your code and get the"getFlagData" response like that: ["0": testData, "data": testData],when I submitted some data to it using remix.
But ,if I use "setFlagData" method by web3swift in iOS , the "setFlagData" method response is :
string
0000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000046874747000000000000000000000000000000000000000000000000000000000
Full data:
.success([:])
then, I use "getFlagData", the response is the old, not the new.
this is my code:
[1523271638574]<https://user-images.githubusercontent.com/3910941/38494380-5411fb3c-3c28-11e8-91dd-9624418708e6.jpg>
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub<#43 (comment)>, or mute the thread<https://github.com/notifications/unsubscribe-auth/AGKv91OD0nOuwr4kRj5I3qRKGc3tnyJ3ks5tmz-DgaJpZM4TLe2q>.
|
I've found a bug in sending an unsigned transaction to external node. Fixed in #44 |
hi, when I use the lastest code by pod 'web3swift', git: 'https://github.com/BANKEX/web3swift.git',:commit =>'782d5ee' , what can I do? |
Are you using a parity node? Looks like a node doesn’t like EIP155 standard and can not check a signature with a high ChainID. Try to set web3.provider.network = nil and run the same code
…________________________________
From: Kevin <[email protected]>
Sent: Wednesday, April 11, 2018 8:43:08 AM
To: BANKEX/web3swift
Cc: Alexander; Comment
Subject: Re: [BANKEX/web3swift] I can not use my contract ? (#43)
hi,
I use the lastest code version 0.5.0.
but the use "setFlagData" method in contract, the result also is bad.
[1523425045711]<https://user-images.githubusercontent.com/3910941/38598148-d49b11a6-3d8d-11e8-8ad1-57c0e9bab092.jpg>
the log and result is :
sender:
EthereumAddress(_address: "0x696e2405d2c914228e4409307372aacb470ad833")
Signature required 3 rounds
Transaction
Nonce: 0
Gas price: 5000000000
Gas limit: 90000
To: 0xb6b34A03045D8Aa0D210788881bffEc10c4f166e
Value: 0
Data: 0xa46b5b6b0000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000968656c6c6f576562330000000000000000000000000000000000000000000000
v: 191071
r: 115484963803047457941187315055774630604535195829756633299156415369938984242572
s: 5606618538296490632424069479196750027399791712033427709004373420558424659314
Intrinsic chainID: Optional(95518)
Infered chainID: Optional(95518)
sender: Optional("0x696e2405d2C914228E4409307372aACb470aD833")
hash: Optional("0xe8677fee1e5c800b478330c2de6980daf28776a519e5eff1c941c66f94e5d67c")
Transaction
Nonce: 0
Gas price: 5000000000
Gas limit: 90000
To: 0xb6b34A03045D8Aa0D210788881bffEc10c4f166e
Value: 0
Data: 0xa46b5b6b0000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000968656c6c6f576562330000000000000000000000000000000000000000000000
v: 191071
r: 115484963803047457941187315055774630604535195829756633299156415369938984242572
s: 5606618538296490632424069479196750027399791712033427709004373420558424659314
Intrinsic chainID: Optional(95518)
Infered chainID: Optional(95518)
sender: Optional("0x696e2405d2C914228E4409307372aACb470aD833")
hash: Optional("0xe8677fee1e5c800b478330c2de6980daf28776a519e5eff1c941c66f94e5d67c")
set result
.failure(nodeError("invalid sender"))
nodeError("invalid sender")
can you help me check it?
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub<#43 (comment)>, or mute the thread<https://github.com/notifications/unsubscribe-auth/AGKv99wxsKgP567l6KjntTfqk1HDQnUKks5tnZfsgaJpZM4TLe2q>.
|
Hello @wufeiafei Can you test agains the latest master? After #48 you can set a network to nil |
@wufeiafei Fixed by #48 |
i have a question: I already have SmartContract in Solidity, how can i get contract ABI in json? |
If you use Remix, it’s in details on the first tab, near the “compile” button |
hi,
my contract is here:
but, when I use web3wift, the contract is not work.
this is my code:
I use the method"setFlagData" and "getFlagData", but no work.
the result like this:
the "setFlagData" result:
res:
.success([:])
and the "getFlagData" result:
get res:
.success(["0": ""])
what can I do?
The text was updated successfully, but these errors were encountered: