paritytech / js-api

Moved to https://github.com/Parity-JS/api
https://github.com/Parity-JS/api
GNU General Public License v3.0
17 stars 12 forks source link

Error when deploying library #2

Open travs opened 6 years ago

travs commented 6 years ago

Trying to deploy via sendTransaction while #1 is still occurring for me.

Running the code below:

// abi and bytecode already defined
// api constructed as in readme
contract = api.newContract(abi)
encodedOpts = contract._encodeOptions(contract.constructors[0], {data: bytecode}, [])
api.eth.sendTransaction(encodedOpts)

Error I received:

Error: Cannot convert DataFeedInterface to valid ParamType
    at i (/home/travis/prg/protocol/node_modules/@parity/parity.js/library.js:1:30744) 
    at new t (/home/travis/prg/protocol/node_modules/@parity/parity.js/library.js:1:55667)
    at /home/travis/prg/protocol/node_modules/@parity/parity.js/library.js:1:55873
    at Array.map (<anonymous>)
    at Function.value (/home/travis/prg/protocol/node_modules/@parity/parity.js/library.js:1:55833)
    at new t (/home/travis/prg/protocol/node_modules/@parity/parity.js/library.js:1:42315)     
    at /home/travis/prg/protocol/node_modules/@parity/parity.js/library.js:1:93191
    at Array.map (<anonymous>)
    at Function.value (/home/travis/prg/protocol/node_modules/@parity/parity.js/library.js:1:93045)          
    at e.t (/home/travis/prg/protocol/node_modules/@parity/parity.js/library.js:1:92299)

Contract's ABI:

[ { constant: true,                                                                            
    inputs: [ [Object] ],                                                                      
    name: 'grossAssetValue',                                                                   
    outputs: [ [Object] ],                                                                     
    payable: false,                                                                            
    stateMutability: 'view',                                                                   
    type: 'function' },                                                                        
  { constant: true,                                                                            
    inputs: [ [Object], [Object], [Object], [Object] ],                                        
    name: 'priceForNumBaseShares',                                                             
    outputs: [ [Object] ],                                                                     
    payable: false,                                                                            
    stateMutability: 'view',                                                                   
    type: 'function' },                                                                        
  { constant: true,                                                                            
    inputs: [ [Object], [Object] ],                                                            
    name: 'netAssetValue',                                                                     
    outputs: [ [Object] ],                                                                     
    payable: false,                                                                            
    stateMutability: 'view',
    type: 'function' } ]

Bytecode is here.

jacogr commented 6 years ago

Ok, this one is weird. Thanks for the Bytecode/ABI, will need to delve in to see where it breaks.

jacogr commented 6 years ago

@travs Could you please supply the ABI without the [Object] as part of the inputs/outputs? (i.e. full json)

travs commented 6 years ago

@jacogr We may have changed a few things since I posted this, so not sure if this will still fail for you. Will supply the bytecode again as well: