Skip to content

Commit

Permalink
chore: update for PR comments
Browse files Browse the repository at this point in the history
  • Loading branch information
darrenvechain committed Nov 27, 2024
1 parent ddfce41 commit c86d9f8
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 12 deletions.
8 changes: 4 additions & 4 deletions api/accounts/accounts.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ type Accounts struct {
callGasLimit uint64
forkConfig thor.ForkConfig
bft bft.Committer
deprecatedEnabled bool
enabledDeprecated bool
}

func New(
Expand All @@ -41,15 +41,15 @@ func New(
callGasLimit uint64,
forkConfig thor.ForkConfig,
bft bft.Committer,
deprecatedEnabled bool,
enabledDeprecated bool,
) *Accounts {
return &Accounts{
repo,
stater,
callGasLimit,
forkConfig,
bft,
deprecatedEnabled,
enabledDeprecated,
}
}

Expand Down Expand Up @@ -171,7 +171,7 @@ func (a *Accounts) handleGetStorage(w http.ResponseWriter, req *http.Request) er
}

func (a *Accounts) handleCallContract(w http.ResponseWriter, req *http.Request) error {
if !a.deprecatedEnabled {
if !a.enabledDeprecated {
return utils.HTTPError(nil, http.StatusGone)
}
callData := &CallData{}
Expand Down
4 changes: 2 additions & 2 deletions api/accounts/accounts_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@ func getStorageWithNonExistingRevision(t *testing.T) {
assert.Equal(t, "revision: leveldb: not found\n", string(res), "revision not found")
}

func initAccountServer(t *testing.T, deprecatedEnabled bool) {
func initAccountServer(t *testing.T, enabledDeprecated bool) {
thorChain, err := testchain.NewIntegrationTestChain()
require.NoError(t, err)

Expand All @@ -306,7 +306,7 @@ func initAccountServer(t *testing.T, deprecatedEnabled bool) {
)

router := mux.NewRouter()
accounts.New(thorChain.Repo(), thorChain.Stater(), uint64(gasLimit), thor.NoFork, thorChain.Engine(), deprecatedEnabled).
accounts.New(thorChain.Repo(), thorChain.Stater(), uint64(gasLimit), thor.NoFork, thorChain.Engine(), enabledDeprecated).
Mount(router, "/accounts")

ts = httptest.NewServer(router)
Expand Down
8 changes: 4 additions & 4 deletions api/subscriptions/subscriptions.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ const txQueueSize = 20

type Subscriptions struct {
backtraceLimit uint32
deprecatedEnabled bool
enabledDeprecated bool
repo *chain.Repository
upgrader *websocket.Upgrader
pendingTx *pendingTx
Expand All @@ -51,11 +51,11 @@ const (
pingPeriod = (pongWait * 7) / 10
)

func New(repo *chain.Repository, allowedOrigins []string, backtraceLimit uint32, txpool *txpool.TxPool, deprecatedEnabled bool) *Subscriptions {
func New(repo *chain.Repository, allowedOrigins []string, backtraceLimit uint32, txpool *txpool.TxPool, enabledDeprecated bool) *Subscriptions {
sub := &Subscriptions{
backtraceLimit: backtraceLimit,
repo: repo,
deprecatedEnabled: deprecatedEnabled,
enabledDeprecated: enabledDeprecated,
upgrader: &websocket.Upgrader{
EnableCompression: true,
CheckOrigin: func(r *http.Request) bool {
Expand Down Expand Up @@ -197,7 +197,7 @@ func (s *Subscriptions) handleSubject(w http.ResponseWriter, req *http.Request)
return err
}
case "beat":
if !s.deprecatedEnabled {
if !s.enabledDeprecated {
return utils.HTTPError(nil, http.StatusGone)
}
if reader, err = s.handleBeatReader(w, req); err != nil {
Expand Down
4 changes: 2 additions & 2 deletions api/subscriptions/subscriptions_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ func TestParseAddress(t *testing.T) {
assert.Equal(t, expectedAddr, *result)
}

func initSubscriptionsServer(t *testing.T, deprecatedEnabled bool) {
func initSubscriptionsServer(t *testing.T, enabledDeprecated bool) {
thorChain, err := testchain.NewIntegrationTestChain()
require.NoError(t, err)

Expand Down Expand Up @@ -274,7 +274,7 @@ func initSubscriptionsServer(t *testing.T, deprecatedEnabled bool) {
require.NoError(t, err)

router := mux.NewRouter()
New(thorChain.Repo(), []string{}, 5, txPool, deprecatedEnabled).
New(thorChain.Repo(), []string{}, 5, txPool, enabledDeprecated).
Mount(router, "/subscriptions")
ts = httptest.NewServer(router)
}
Expand Down

0 comments on commit c86d9f8

Please sign in to comment.