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

web3.eth.transact is not returning any value #68

Closed
KenKappler opened this issue Feb 21, 2015 · 10 comments
Closed

web3.eth.transact is not returning any value #68

KenKappler opened this issue Feb 21, 2015 · 10 comments

Comments

@KenKappler
Copy link

Executing the below in the JS console:

var source = "" +
"contract test {\n" +
" function multiply(uint a) returns(uint d) {\n" +
" return a * 7;\n" +
" }\n" +
"}\n";
var compiled = web3.eth.solidity(source);
var address = web3.eth.transact({code: compiled});
console.log(address);

Produces:

Error: NETWORK_ERR: XMLHttpRequest Exception 101
code: 101
constructor: XMLHttpRequestExceptionConstructor
line: 1063
message: "NETWORK_ERR: XMLHttpRequest Exception 101"
name: "NETWORK_ERR"
stack: "send@[native code]↵send↵send↵↵eval code↵eval@[native code]↵evaluate@[native code]↵_evaluateOn↵_evaluateAndWrap↵evaluate"
proto: XMLHttpRequestExceptionPrototype

This function is also causing a lot of problems within the GUI

@androlo
Copy link

androlo commented Feb 24, 2015

Right now I can send transactions, but when doing the deploy via http it returns a garbage character instead of the address. Printing the http request I get this:

{ jsonrpc: '2.0',
  method: 'eth_transact',
  params: [ { data: '0x60056013565b610....' } ],
  id: 4 }

I always get the value 0x01 back:
{"id":4,"jsonrpc":"2.0","result":"\u0001"}

This is on latest dev, aleth + ethereum.js, doing things exactly like in the examples. Tried just sending a contract contract Test {} as well, which compiles in aleth (this is not a failure to compile, and I got plenty of funds). Not sure why this is happening.

@androlo
Copy link

androlo commented Feb 24, 2015

Looks like the contracts are indeed created though:

> listContracts
00d7b8ed11b2ad2d28a548630cef58602ea28146 : 0 [0]
027a953156f5033479ee1e541857849e14471a0f : 0 [0]
07ca285cdcdeaf8f90798f5767ffc917f719df37 : 0 [0]
122c290de317f11601f1502e56ad511d1a2684da : 0 [0]
1764fcd484d1097353b5d7f05af14c2a0de20e61 : 0 [0]
188aede27fb3b4def9213f31ef4982542c06f029 : 0 [0]
1e293d94f4528a8fb8abf97e62aabf750d8b7766 : 0 [0]
263ee26f2067144d9758a197580fcc8a8b4dd021 : 0 [0]
2e794522178ae323d94bf6daf4b1c730135f53df : 0 [0]
33e61609e49bdc2c2d881efab1f92ab2d756b151 : 0 [0]
35149361ef219afc1ae982a5470547dbaf542ff0 : 0 [0]
3a2a72dc92d3eb41cfeb0cc3644c7960b8c23733 : 0 [0]
472e0c89fa1343efcc8a1bbcfd57bde70ae775df : 0 [0]
551b4e7cdb6ae637abcffcc28eb2f942c7212fbf : 0 [0]
5d2e7e917e8962cff3d3b9e79d0d4f695851b260 : 0 [0]
5dcbd078c818eddc4c2055b63309428b70249ff6 : 0 [0]
6237d81cb0c019162b46b1869fe241b2bb2df267 : 0 [0]
64f9f493b7626e1b645d45c08702e44298e93ec5 : 0 [0]
6c332b83eca22d82cbb82cbb3841e90819eb1ba5 : 0 [0]
7081b49a8689d9d1b7a6679f664c5b12fbc322cd : 0 [0]
8441ce9520b43fd98bda6dfe70e2969786b89347 : 0 [0]
8a38c537e3f363c04667c45d19358e5f9313eafb : 0 [0]
9d296a5e81ca4d08b35631a4a299e714c0614ce7 : 0 [0]
9dbfac9257772432a3c2811a19c72a94d41a10eb : 0 [0]
ad13980fff2015a521ed66f5da55eaa53a3212ba : 0 [0]
ae8843ce37709155ad08830435666a4589536c6f : 0 [0]
b1bf891838611f82e2118b8880383bd47b15d6c8 : 0 [0]
ba0d07f9c8a05aae40e58a206e14bf93a65637f5 : 0 [0]
c049801f5fa9ac23005c371683c3a34629ec4a77 : 0 [0]
c7d4fbc052bacea3ea74daa95c702de62401485a : 0 [0]
d8c500fb0b6531a891b7ea12c47db364b4f5a7b2 : 0 [0]
ef2bb780d3bb1ef3a12ce8223d072555b906fce8 : 0 [0]
f58febfeea25360326858cb749a82b1e6df1028d : 0 [0]
f86467ae840d122460ca42eea742ef8bd81d0db6 : 0 [0]
f998087ae558d589607adef60cd6d6ac2f2c3682 : 0 [0]
fa06cbb7c1cc4824bd88526c9ae7590b2a26f17c : 0 [0]
fcdec675607f8e827a9f5d45a7303a121097a51d : 0 [0]
fec16ae8ab6b2b7ee5d8876752c5840d4f1bbcd1 : 0 [0]

Been going at it for a while...

@jorisbontje
Copy link
Contributor

Related cpp-ethereum issue: ethereum/aleth#1102

Hopefully this will be fixed by ethereum/aleth#1120

@androlo
Copy link

androlo commented Feb 24, 2015

ooh hash -> bool, makes sense. thanks for the info.

@debris
Copy link
Contributor

debris commented Feb 24, 2015

should be fixed in latest cpp-ethereum develop, please check ;)

@androlo
Copy link

androlo commented Feb 24, 2015

works for me. pushed 20 contracts or so.

@jorisbontje
Copy link
Contributor

its returning an address again, but the contracts still dont get mined.

@androlo
Copy link

androlo commented Feb 24, 2015

Weird. It works for me. Log dump from webstorm javascript console:

Active account: 0x338ceb654955602379882180fe59d8fef4361ac6
/home/androlo/WebstormProjects/FundManager/application
Loaded contract: doug.sol
Loaded contract: usersdb.sol
Loaded contract: users.sol
Loaded contract: bankdb.sol
Loaded contract: bank.sol
Loaded contract: fundmanager.sol
Starting deployment.
Block number at start: 478
Deploying Doug.
Address: 0x2bba0cb2fb2bbff039379285e53d476ca45c11dc
Express server listening on port 3000
New block: 479
Deploying UsersDb.
Address: 0x3ca88f75853d538964e84586b4a868c95ad3bdaa
New block: 480
Deploying Users.
Address: 0xe116c8c8da3f83ecf50dd79fbf33ae9654527e87
New block: 481
Deploying BankDb.
Address: 0xf4398266f6cc947882dce11ebb58e356973d3d98
New block: 482
Deploying Bank.
Address: 0x249f91d9eb7ca9e6eff3c6b4e55004fd15141365
New block: 483
Deploying FundManager.
Address: 0x23ac76be6e31f5b1994088a354e8b684e329b4f3
New block: 484
New block: 485
Deployed successfully

Also listed contracts from eth cli and i find them there.

Could it be your contracts has old visibility specifiers in them, like protected? Caught me a bit off guard... couldn't understand why it didn't compile all over sudden but checked aleth and confirmed they didn't compile.

@kumavis
Copy link
Contributor

kumavis commented Feb 28, 2015

new ethereum.js versions will not return a value for web3.eth.transact. This is b/c calling transact does not immediately add it to the blockchain, it will add it to a queue of transactions requested by the dapp, that the user will later confirm or reject.

@kumavis
Copy link
Contributor

kumavis commented Feb 28, 2015

closing this for now, feel free to continue discussion / ask questions

@kumavis kumavis closed this as completed Feb 28, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants