Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
N
nebula
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
exchain
nebula
Commits
6f87ca84
Commit
6f87ca84
authored
Aug 12, 2023
by
Will Cory
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat(indexer): Preallocate space for a slice
parent
e5e50040
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
2 deletions
+2
-2
deposits.go
indexer/api/routes/deposits.go
+1
-1
withdrawals.go
indexer/api/routes/withdrawals.go
+1
-1
No files found.
indexer/api/routes/deposits.go
View file @
6f87ca84
...
...
@@ -30,7 +30,7 @@ type DepositResponse struct {
// TODO this is original spec but maybe include the l2 block info too for the relayed tx
// FIXME make a pure function that returns a struct instead of newWithdrawalResponse
func
newDepositResponse
(
deposits
[]
*
database
.
L1BridgeDepositWithTransactionHashes
)
DepositResponse
{
var
items
[]
DepositItem
items
:=
make
([]
DepositItem
,
len
(
deposits
))
for
_
,
deposit
:=
range
deposits
{
item
:=
DepositItem
{
Guid
:
deposit
.
L1BridgeDeposit
.
TransactionSourceHash
.
String
(),
...
...
indexer/api/routes/withdrawals.go
View file @
6f87ca84
...
...
@@ -43,7 +43,7 @@ type WithdrawalResponse struct {
// FIXME make a pure function that returns a struct instead of newWithdrawalResponse
func
newWithdrawalResponse
(
withdrawals
[]
*
database
.
L2BridgeWithdrawalWithTransactionHashes
)
WithdrawalResponse
{
var
items
[]
WithdrawalItem
items
:=
make
([]
WithdrawalItem
,
len
(
withdrawals
))
for
_
,
withdrawal
:=
range
withdrawals
{
item
:=
WithdrawalItem
{
Guid
:
withdrawal
.
L2BridgeWithdrawal
.
TransactionWithdrawalHash
.
String
(),
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment