Skip to content

Commit

Permalink
Add: getTransactionCount -> getNextNonce
Browse files Browse the repository at this point in the history
  • Loading branch information
yqrashawn committed Apr 16, 2020
1 parent 63cc916 commit 0036f0f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion app/scripts/controllers/network/createCfxMiddleware.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ const createAsyncMiddleware = require('json-rpc-engine/src/createAsyncMiddleware
module.exports = { createCfxRewriteRequestMiddleware, alterRpcMethodAndParams }

const MethodsWithDefaultEpochParameter = {
cfx_getTransactionCount: 1,
cfx_getNextNounce: 1,
cfx_getBalance: 1,
cfx_getBlockByEpochNumber: 0,
cfx_epochNumber: 0,
Expand All @@ -13,6 +13,7 @@ const MethodsWithDefaultEpochParameter = {
function alterRpcMethodAndParams ({ method = '', params = {} } = {}) {
if (method) {
method = method.replace('eth_', 'cfx_')
method = method.replace('getTransactionCount', 'getNextNonce')
method = method.replace('getBlockByNumber', 'getBlockByEpochNumber')
method = method.replace('cfx_blockNumber', 'cfx_epochNumber')
}
Expand Down

0 comments on commit 0036f0f

Please sign in to comment.