Negative integers mishandling on JavaScript side

Doing a basic cons operation on a list that contains negative integer results in an error
on the Javascript side. Please take a look.
I use the latest aeproject 2.2.0

[shishkin@oberon sophia_test]$ cat contracts/DPLL.aes 
include "List.aes"

contract DPLL =
   entrypoint ins(cl: list(int)): list(int) =
     6 :: cl
[shishkin@oberon sophia_test]$ cat test/dpllTest.js                                                                                      
const Deployer = require('aeproject-lib').Deployer;
const CONTRACT_PATH = "./contracts/DPLL.aes";                    
                                  
describe('DPLL Contract', () => {
  // <skipped, general stuff>
    it('ins test', async() => {
        let res = (await instance.ins([-1, -2])).decodedResult;
        console.log(res);
        assert.isTrue(res == [6, -1, -2], 'invalid result');
    })
}

running “aeproject test” results in:

1) DPLL Contract
      ins test:
    Error: Http request for http://localhost:3080/decode-call-result failed with status code 500. Status: Internal Server Error. 
Error data: ""
     at /home/shishkin/src/sophia_test/node_modules/@aeternity/aepp-sdk/dist/aepp-sdk.js:1:157427
     at s (node_modules/@aeternity/aepp-sdk/dist/aepp-sdk.js:1:17600)
     at Generator._invoke (node_modules/@aeternity/aepp-sdk/dist/aepp-sdk.js:1:17353)
     at Generator.forEach.t.(anonymous function) [as throw] (node_modules/@aeternity/aepp-sdk/dist/aepp-sdk.js:1:17957)
     at n (node_modules/@aeternity/aepp-sdk/dist/aepp-sdk.js:1:2377)
     at s (node_modules/@aeternity/aepp-sdk/dist/aepp-sdk.js:1:2624)
     at process._tickCallback (internal/process/next_tick.js:68:7)

If I give a list of positive integers, everything works great.

[ 6, 1, 2, 3 ]                                                      
    1) ins test      

I am not sure if this is:

It works in Sophia (and I’ve also tested it in the HTTP version of the compiler).

1 Like

Thank you @hanssv.chain for the fast reaction. So the problem is in the toolchain.

Do we have any progress towards resolving this issue?

I guess this goes to @davidyuk

@unboxedtype what version of compiler are you using? I’m able to reproduce this issue using 4.1.0, but can’t in the 4.3.2

I do not invoke the compiler directly, but using an aeproject toolset instead, which, I suppose, does
this thing for me. Aeproject version 2.2.0, which, was the latest at the time of submitting the issue.

1 Like

So most likely the issue is in Aeproject using the old compiler, cc @hristiyanAE.chain