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

getting error when query transaction #24

Open
kenken64 opened this issue Jul 22, 2019 · 4 comments
Open

getting error when query transaction #24

kenken64 opened this issue Jul 22, 2019 · 4 comments
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@kenken64
Copy link

kenken64 commented Jul 22, 2019

/home/kenneth/Projects/facebook_libra_workshop/server/node_modules/libra-
core/build/client/Decoder.js:39
        const signedTransaction = signedTransactionWP.getSignedTransaction();
                                                      ^

TypeError: Cannot read property 'getSignedTransaction' of undefined
    at ClientDecoder.decodeSignedTransactionWithProof (/home/kenneth/Projects/facebook_libra_workshop/server/node_modules/libra-core/build/client/Decoder.js:39:55)
    at /home/kenneth/Projects/facebook_libra_workshop/server/node_modules/libra-core/build/client/index.js:109:38
    at Object.onReceiveStatus (/home/kenneth/Projects/facebook_libra_workshop/server/node_modules/grpc/src/client_interceptors.js:1207:9)
    at InterceptingListener._callNext (/home/kenneth/Projects/facebook_libra_workshop/server/node_modules/grpc/src/client_interceptors.js:568:42)
    at InterceptingListener.onReceiveStatus (/home/kenneth/Projects/facebook_libra_workshop/server/node_modules/grpc/src/client_interceptors.js:618:8)
    at callback (/home/kenneth/Projects/facebook_libra_workshop/server/node_modules/grpc/src/client_interceptors.js:845:24)
@kenken64
Copy link
Author

kenken64 commented Jul 22, 2019

async function getTransactions(accountNumber, sequenceNumber, cb) {
  console.log("seq number " + typeof sequenceNumber);
  const transaction = await client.getAccountTransaction(
    accountNumber,
    sequenceNumber
  );
  cb(transaction);
}

app.get(`${API_URL}/transactions/:address/:sequenceNo`, (req, res) => {
  const address = req.params.address || FALLBACK_ADDRESS;
  console.log(address);
  const sequenceNumber = req.params.sequenceNo || 0;
  try {
    getTransactions(address, parseInt(sequenceNumber), transaction => {
      console.log(transaction);
      res.status(200).json(transaction);
    });
  } catch (error) {
    console.log(error);
    res.status(500).json(error);
  }
});

@kenken64
Copy link
Author

I know why I have not done a coin transfer then I query an unavailable transactions

@kenken64
Copy link
Author

I think I would like to re-open this issue there isn't any way to catch the TypeError from outside so I can flag out that no query record is created yet

@kenken64 kenken64 reopened this Jul 23, 2019
@perfectmak
Copy link
Owner

This is true. I thought I already caught the case for when a transaction doesn't exist. I'll queue this fix in the current upcoming fixes. Or if you have enough bandwith, your contribution would be welcome

@perfectmak perfectmak added enhancement New feature or request help wanted Extra attention is needed labels Aug 17, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants