These are chat archives for Nethereum/Nethereum

3rd
Aug 2017
@weitaolee
Aug 03 2017 04:26
just does not get mined
not using offline signing
@kaista82_twitter
kai
@kaista82_twitter
Aug 03 2017 10:23
what balance in main account? what gas price/limit did you use and was it the same gas settings as when sending from the account that works
@weitaolee
Aug 03 2017 11:10
Find the problem
Juan Blanco
@juanfranblanco
Aug 03 2017 11:11
what was it?
I call this method, and the gas price is 0
the 0 gas price txn block,then next txn can not send sucess
image.png
Juan Blanco
@juanfranblanco
Aug 03 2017 11:15
sorry but why is the gas price 0?
are you setting it to 0?
@weitaolee
Aug 03 2017 11:17
No,I just call it like -->var _standardToken = new StandardTokenService(_web3, _token);
await _standardToken.TransferAsync(_mainAccount, req.Address, value, new HexBigInteger(300000));
Can not set gasprice
Juan Blanco
@juanfranblanco
Aug 03 2017 11:18
and you are setting the value as 0
i guess
as you are not sending any amount
@weitaolee
Aug 03 2017 11:19
value is 0.01
Transferred 0.01000 GNT
this value is erc20token value
Juan Blanco
@juanfranblanco
Aug 03 2017 11:20
yes which is different to value
as per ether value
@weitaolee
Aug 03 2017 11:21
public async Task<string> TransferAsync<T>(string addressFrom, string addressTo, T value, HexBigInteger gas = null)
the parameter "value" in this method is token value, and not have a gasprice parameter
I think add a gasprice parameter can solve it
Juan Blanco
@juanfranblanco
Aug 03 2017 11:24
how do you create web3
what parameters you pass?
@weitaolee
Aug 03 2017 11:25
new Web3(url)
Juan Blanco
@juanfranblanco
Aug 03 2017 11:25
so you unlock your account
using personal
@weitaolee
Aug 03 2017 11:25
yes, unlock myaccount before send txn
Juan Blanco
@juanfranblanco
Aug 03 2017 11:25
ok
@weitaolee
Aug 03 2017 11:26
I need have compatibility with etc
when I use personal for etc, tell me can not find the method signandsendtransaction
so I can not use personal
Juan Blanco
@juanfranblanco
Aug 03 2017 11:28
ok
so etc does not provide the personal sing and send transaction
@weitaolee
Aug 03 2017 11:29
Yes,I have test it with the lastest etc client
v3.5.0.68
Juan Blanco
@juanfranblanco
Aug 03 2017 11:29
i have checked the code and there is no place that the gas price is overriden
@weitaolee
Aug 03 2017 11:30
I do not know why,but the result show us : the gasprice is 0
Juan Blanco
@juanfranblanco
Aug 03 2017 11:30
what you can doe
@weitaolee
Aug 03 2017 11:31
and I use wireshake, I get the request data, the gasprice is 0
Juan Blanco
@juanfranblanco
Aug 03 2017 11:31
hmm that should be null all the time
as we don't override the values when not set
we / i
ok can you do two things whilst you are at it
@weitaolee
Aug 03 2017 11:33
yes , go ahead
Juan Blanco
@juanfranblanco
Aug 03 2017 11:36
sorry just checking somethin
something*
@weitaolee
Aug 03 2017 11:36
not at all, thanks for your help
Juan Blanco
@juanfranblanco
Aug 03 2017 11:37
when instantiating web3 set : web3.TransactionManager.DefaultGasPrice
@weitaolee
Aug 03 2017 11:37
ok
done!
@weitaolee
Aug 03 2017 11:42
every txn sucess
Juan Blanco
@juanfranblanco
Aug 03 2017 11:44
have you got the wireshark for both
just trying to figure out where the problem is
as it should be always null when transfered and hence use the default values from the client (ie parity)
thanks!
@weitaolee
Aug 03 2017 11:46
ok,I will get the request data for you
Juan Blanco
@juanfranblanco
Aug 03 2017 11:46
thanks!
@weitaolee
Aug 03 2017 11:48
{"id":1,"jsonrpc":"2.0","method":"eth_sendTransaction","params":[{"from":"0xc45d3dcb56165c457e0e8ff5dad56765e0dd6d74","to":"0xa74476443119a942de498590fe1f2454d7d4ac0d","gas":"0x493e0","gasPrice":"0x0","data":"0xa9059cbb0000000000000000000000000089a73a2b8ed59b4caf457898066ff6ffb7b0f7000000000000000000000000000000000000000000000000002386f26fc10000"}]}
this is the request data when not set default gasprice
Juan Blanco
@juanfranblanco
Aug 03 2017 11:50
ok cool thanks!
@weitaolee
Aug 03 2017 11:51
{"id":1,"jsonrpc":"2.0","method":"eth_sendTransaction","params":[{"from":"0xc45d3dcb56165c457e0e8ff5dad56765e0dd6d74","to":"0xa74476443119a942de498590fe1f2454d7d4ac0d","gas":"0x493e0","gasPrice":"0x4e3b29200","data":"0xa9059cbb0000000000000000000000000089a73a2b8ed59b4caf457898066ff6ffb7b0f7000000000000000000000000000000000000000000000000002386f26fc10000"}]}
this is the request data when set default gasprice =0.000000021 eth
:)
Juan Blanco
@juanfranblanco
Aug 03 2017 11:51
yes 21 shannon
i think i am going to force default values for all of the scenarios (including the unmanaged / not offlined signed)
@weitaolee
Aug 03 2017 11:54
good idea
Juan Blanco
@juanfranblanco
Aug 03 2017 11:58
what is interesting is that you have overriden the transaction price
gas price
using the default values
so the transaction input is not set in the background
so some how when serializing it feels to put a 0 there instead of ignoring it
and we have set it to ignore null values
kai
@kaista82_twitter
Aug 03 2017 13:00
woop so we worked it out, gas price after all
@weitaolee
Aug 03 2017 13:32
I have no code about override gas price, and gas price should be not 0 when user need to send txn
and when create web3=new Web3(url); web3.TransactionManager.DefaultGasprice is 0;
kai
@kaista82_twitter
Aug 03 2017 13:37
Personally I think 0 is fine as I don't want to to send more than I want, but I think Juan was talking about a gas price estimator maybe, that would help this situation
is there no override like when you sign offline?
@weitaolee
Aug 03 2017 13:39
No,I just call it like -->var _standardToken = new StandardTokenService(_web3, _token);
await _standardToken.TransferAsync(_mainAccount, req.Address, value, new HexBigInteger(300000));
I just call ERC20Token method
kai
@kaista82_twitter
Aug 03 2017 13:40
ahh ok
@weitaolee
Aug 03 2017 13:40
There no place to override gasprice
kai
@kaista82_twitter
Aug 03 2017 13:41
is web3.TransactionManager.DefaultGasprice readonly?
@weitaolee
Aug 03 2017 13:42
No, {get;set;}
kai
@kaista82_twitter
Aug 03 2017 13:43
so if you set it, its fine yeah? maybe someone can add an override to transferasync at some point to save you having to do a manual web3.TransactionManager.DefaultGasprice=21001
@weitaolee
Aug 03 2017 13:44
Yes,agree
kai
@kaista82_twitter
Aug 03 2017 13:44
I would write a little wrapper function for now to handle it which passes the gas over to defaultgasprice
untill the library is updated (if deemed it should be updated)
@weitaolee
Aug 03 2017 13:45
Thanks
public async Task<string> TransferAsync<T>(string addressFrom, string addressTo, T value, HexBigInteger gas = null,HexBigInter gasPrice=null)
{
var function = GetTransferFunction();
return await function.SendTransactionAsync(addressFrom, gas,gasPrice, null, addressTo, value);
}
function.SendTransactionAsync can set gasprice ,so the overriden of TransferAsync which add a gasprice parameter call it