Giter Site home page Giter Site logo

oasisscan-backend's People

Contributors

romever avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

oasisscan-backend's Issues

Incorrect transaction hash for regular ParaTime transactions

It seems that the hash of regular ParaTime transactions is computed incorrectly. From looking at this part:

for (RuntimeTransactionWithResult r : list) {
try {
JsonNode rawJson = Mappers.parseCborFromBase64(r.getTx(), new TypeReference<JsonNode>() {
});
if (!rawJson.isArray()) {
continue;
}
String raw = rawJson.get(0).asText();
String type = rawJson.get(1).toString();

The raw field contains only the inner transaction body without the signature. And the hash is then computed like this:

But the hash should be computed over the whole signed transaction blob (e.g. over r.getTx()).

ParaTime transactions appear to be no longer indexed

I made a deposit from a consensus account into an Emerald ParaTime account:
Screenshot from 2022-07-29 20-19-06
Screenshot from 2022-07-29 20-19-15
Screenshot from 2022-07-29 20-19-46

Clicking on the "View transaction records through explorer" redirects to:
https://www.oasisscan.com/paratimes/transactions/031efeabaa315e5c7b4fea4b89585063af63960e8c7a123265e32cd96c761a4e?runtime=000000000000000000000000000000000000000000000000e2eaa99fc008f87f

which shows nothing:
Screenshot from 2022-07-29 20-21-05

The Oasis Scan account page:
https://www.oasisscan.com/accounts/detail/oasis1qqk86skatdsuhq8a5qcyt9s8pf37etjrfqsdce5p

It shows the consensus part of the deposit into Emerald:

  • a staking.Allow txn
  • a roothash.ExecutorCommit txn which shows the event from the chosen consensus account into the Emerald consensus account)

However, switching to the Paratime tab in the Transactions panel doesn't show anything for this txn:
Screenshot from 2022-07-29 20-30-51

API: wrong data about burn transactions

Hi, I see something that might be a bug in the API implementation.

Please pardon me if this is the wrong forum to report this; I couldn't find an obvious link on either the OasisScan.com website or in the README of this repo.

See this transaction: https://testnet.oasisscan.com/transactions/5e1b8a01043505741014213a8fd19996eb68621881eb5aceac24f28a5c2820ab

As you can see, this is a burn, and the content is described as:

 {
  "tx_hash": "5e1b8a01043505741014213a8fd19996eb68621881eb5aceac24f28a5c2820ab",
  "method": "staking.Burn",
  "fee": {
    "gas": 1235
  },
  "body": {
    "amount": "1000000000"
  },
  "nonce": 0,
  "signature": {
    "signature": "S0IiWGwa/WgvHxOpoYjhCKfmstx0u5ZHvBHXhRjQSs76MRm47VnOQ+p2FvqZjqUxB1LmPeiffVV7m01sG6mlAw==",
    "public_key": "9aBykPfe7o9BWtdjwWmQh0lnaiQmBG/58vhYPROFIDo=",
    "address": "oasis1qqurxkgavtcjjytneumeclx59ds3avjaqg7ftqph"
  },
  "height": 11753025,
  "timestamp": 1663855390,
  "time": "2022-09-22T14:03:10Z",
  "error": {
    "code": 0
  },

Notice the amount.

Now if I get this transaction (along with another one), via the API

curl --silent "https://api.oasisscan.com/testnet/chain/transactions?size=20&address=oasis1qqurxkgavtcjjytneumeclx59ds3avjaqg7ftqph&runtime=true"

Then I get this data:

{
   "code" : 0,
   "data" : {
      "list" : [
         {
            "add" : true,
            "amount" : null,
            "fee" : "0",
            "from" : "oasis1qqurxkgavtcjjytneumeclx59ds3avjaqg7ftqph",
            "height" : 11753025,
            "method" : "staking.Burn",
            "shares" : null,
            "status" : true,
            "time" : 5065,
            "timestamp" : 1663855390,
            "to" : null,
            "txHash" : "5e1b8a01043505741014213a8fd19996eb68621881eb5aceac24f28a5c2820ab"
         },
         {
            "add" : true,
            "amount" : "10.00",
            "fee" : "0",
            "from" : "oasis1qzna6nq9kuktjmxx2s84z38eysqyts84jc9lgdg2",
            "height" : 11751888,
            "method" : "staking.Transfer",
            "shares" : null,
            "status" : true,
            "time" : 11412,
            "timestamp" : 1663849043,
            "to" : "oasis1qqurxkgavtcjjytneumeclx59ds3avjaqg7ftqph",
            "txHash" : "2ea41a6b2c8d05d67e73543d0d1045c63fe553901a6dd430af4c6e6d22680588"
         }
      ],
      "maxPage" : 1,
      "page" : 1,
      "size" : 20,
      "totalSize" : 2
   }
}

Here, from the two returned transaction, we are looking at the first one, the burn.
Please note that both the amount and the fee is returned as null and zero, contrary to what was listed directly on the web site.

Am I missing something here, or is this a bug? Thank you for looking into this.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.