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

docknetwork Fee calculation not supported for this network #510

Closed
vae520283995 opened this issue Apr 8, 2021 · 2 comments · Fixed by #511
Closed

docknetwork Fee calculation not supported for this network #510

vae520283995 opened this issue Apr 8, 2021 · 2 comments · Fixed by #511

Comments

@vae520283995
Copy link

Description

PartialFee cannot be obtained when the version of substrate-api-sidecar>=4.0.3

Steps to Reproduce

/blocks/5245360

{
"method": {
"pallet": "balances",
"method": "transfer"
},
"signature": {
"signature": "0xfc65a4826337e3930ee59c5e7406c20d1258c1bf5c3adf05e348a97ff20944ee4b8a086f10692de33206ab6d78d96cc755d6e5a65c2238a88086f5eb6319bf0b",
"signer": "3HyecpVX6pA7oSuQGx9AWQYUxfy1jEjtypMGcBGTtFAWgML9"
},
"nonce": "405",
"args": {
"dest": "3CL2b3uaFLzJDirNe8WiqJDLDp8gEb5XvuA97swgugiEZJ7u",
"value": "40097000000"
},
"tip": "0",
"hash": "0xde82180c7a2f839391da9e6e04aaf55d378b573da7b3ba6208d2bb5e3e4d973c",
"info": {
"error": "Fee calculation not supported for this network"
},
"events": [
{
"method": {
"pallet": "balances",
"method": "Transfer"
},
"data": [
"3HyecpVX6pA7oSuQGx9AWQYUxfy1jEjtypMGcBGTtFAWgML9",
"3CL2b3uaFLzJDirNe8WiqJDLDp8gEb5XvuA97swgugiEZJ7u",
"40097000000"
]
},
{
"method": {
"pallet": "system",
"method": "ExtrinsicSuccess"
},
"data": [
{
"weight": "190949000",
"class": "Normal",
"paysFee": "Yes"
}
]
}
],
"success": true,
"paysFee": true
}

Expected vs. Actual Behavior

{
"method": {
"pallet": "balances",
"method": "transfer"
},
"signature": {
"signature": "0xfc65a4826337e3930ee59c5e7406c20d1258c1bf5c3adf05e348a97ff20944ee4b8a086f10692de33206ab6d78d96cc755d6e5a65c2238a88086f5eb6319bf0b",
"signer": "3HyecpVX6pA7oSuQGx9AWQYUxfy1jEjtypMGcBGTtFAWgML9"
},
"nonce": "405",
"args": {
"dest": "3CL2b3uaFLzJDirNe8WiqJDLDp8gEb5XvuA97swgugiEZJ7u",
"value": "40097000000"
},
"tip": "0",
"hash": "0xde82180c7a2f839391da9e6e04aaf55d378b573da7b3ba6208d2bb5e3e4d973c",
"info": {
"weight": "190949000",
"class": "Normal",
"partialFee": "2075000"
},
"events": [
{
"method": {
"pallet": "balances",
"method": "Transfer"
},
"data": [
"3HyecpVX6pA7oSuQGx9AWQYUxfy1jEjtypMGcBGTtFAWgML9",
"3CL2b3uaFLzJDirNe8WiqJDLDp8gEb5XvuA97swgugiEZJ7u",
"40097000000"
]
},
{
"method": {
"pallet": "system",
"method": "ExtrinsicSuccess"
},
"data": [
{
"weight": "190949000",
"class": "Normal",
"paysFee": "Yes"
}
]
}
],
"success": true,
"paysFee": true
}

@emostov @lovesh

@lovesh
Copy link
Contributor

lovesh commented Apr 8, 2021

I used master branch of sidecar and am able to see PartialFee when I query /blocks/5245360. Are you connecting to the mainnet node with this URL mainnet-node.dock.io ? Also, are the types correct? Use mainnet tag on both the node and sdk repos when running a node or getting types.

Following is my setup
I created a file .env.dock with content

SAS_SUBSTRATE_WS_URL=wss://mainnet-node.dock.io/
SAS_SUBSTRATE_TYPES=/home/lovesh/dev/substrate-api-sidecar/dock-types.json

In dock-types.json, I had (got from here)

{
  "Address": "AccountId",
  "LookupSource": "AccountId",
  "Keys": "SessionKeys2",
  "Did": "[u8;32]",
  "Bytes32": {
    "value": "[u8;32]"
  },
  "Bytes33": {
    "value": "[u8;33]"
  },
  "Bytes64": {
    "value": "[u8;64]"
  },
  "Bytes65": {
    "value": "[u8;65]"
  },
  "PublicKey": {
    "_enum": {
      "Sr25519": "Bytes32",
      "Ed25519": "Bytes32",
      "Secp256k1": "Bytes33"
    }
  },
  "DidSignature": {
    "_enum": {
      "Sr25519": "Bytes64",
      "Ed25519": "Bytes64",
      "Secp256k1": "Bytes65"
    }
  },
  "KeyDetail": {
    "controller": "Did",
    "public_key": "PublicKey"
  },
  "KeyUpdate": {
    "did": "Did",
    "public_key": "PublicKey",
    "controller": "Option<Did>",
    "last_modified_in_block": "BlockNumber"
  },
  "DidRemoval": {
    "did": "Did",
    "last_modified_in_block": "BlockNumber"
  },
  "RegistryId": "[u8;32]",
  "RevokeId": "[u8;32]",
  "Registry": {
    "policy": "Policy",
    "add_only": "bool"
  },
  "Revoke": {
    "registry_id": "RegistryId",
    "revoke_ids": "BTreeSet<RevokeId>",
    "last_modified": "BlockNumber"
  },
  "UnRevoke": {
    "registry_id": "RegistryId",
    "revoke_ids": "BTreeSet<RevokeId>",
    "last_modified": "BlockNumber"
  },
  "RemoveRegistry": {
    "registry_id": "RegistryId",
    "last_modified": "BlockNumber"
  },
  "PAuth": "BTreeMap<Did, DidSignature>",
  "Policy": {
    "_enum": {
      "OneOf": "BTreeSet<Did>"
    }
  },
  "BlobId": "[u8;32]",
  "Blob": {
    "id": "BlobId",
    "blob": "Vec<u8>",
    "author": "Did"
  },
  "EpochNo": "u32",
  "EpochLen": "u32",
  "SlotNo": "u64",
  "Balance": "u64",
  "BlockNumber": "u32",
  "EpochDetail": {
    "validator_count": "u8",
    "starting_slot": "SlotNo",
    "expected_ending_slot": "SlotNo",
    "ending_slot": "Option<SlotNo>",
    "emission_for_validators": "Option<Balance>",
    "emission_for_treasury": "Option<Balance>"
  },
  "ValidatorStatsPerEpoch": {
    "block_count": "EpochLen",
    "locked_reward": "Option<Balance>",
    "unlocked_reward": "Option<Balance>"
  },
  "Bonus": {
    "swap_bonuses": "Vec<(Balance, BlockNumber)>",
    "vesting_bonuses": "Vec<(Balance, Balance, BlockNumber)>"
  },
  "Payload": {
    "proposal": "Vec<u8>",
    "round_no": "u64"
  },
  "Membership": {
    "members": "BTreeSet<Did>",
    "vote_requirement": "u64"
  },
  "PMAuth": "BTreeMap<Did, DidSignature>",
  "StateChange": {
    "_enum": {
      "KeyUpdate": "KeyUpdate",
      "DidRemoval": "DidRemoval",
      "Revoke": "Revoke",
      "UnRevoke": "UnRevoke",
      "RemoveRegistry": "RemoveRegistry",
      "Blob": "Blob",
      "MasterVote": "Payload"
    }
  }
}

Now I can run sidecar as NODE_ENV=dock yarn start and query.

@vae520283995
Copy link
Author

Now I can run sidecar as NODE_ENV=dock yarn start and query.

I use docker, can you give a step to start with docker

@emostov emostov linked a pull request Apr 8, 2021 that will close this issue
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

Successfully merging a pull request may close this issue.

2 participants