Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
duniter-squid
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
nodes
duniter-squid
Merge requests
!27
add balance to accounts
Code
Review changes
Check out branch
Download
Patches
Plain diff
Open
add balance to accounts
account-balance
into
main
Overview
34
Commits
10
Pipelines
0
Changes
7
Open
poka
requested to merge
account-balance
into
main
2 months ago
Overview
34
Commits
10
Pipelines
0
Changes
1
Expand
close
#11
Edited
2 months ago
by
poka
0
0
Merge request reports
Compare
version 1
version 19
a03a55bc
2 months ago
version 18
43fd6495
2 months ago
version 17
7c54e032
2 months ago
version 16
7f439703
2 months ago
version 15
92db2c03
2 months ago
version 14
87203e75
2 months ago
version 13
0887cf86
2 months ago
version 12
bbe2c317
2 months ago
version 11
b82d0a51
2 months ago
version 10
a4cb8647
2 months ago
version 9
cfd9c222
2 months ago
version 8
4566fd04
2 months ago
version 7
b4bff5bd
2 months ago
version 6
b973edb0
2 months ago
version 5
e7ebcf43
2 months ago
version 4
b973edb0
2 months ago
version 3
0a9c9ed6
2 months ago
version 2
ea99dd5a
2 months ago
version 1
196bd9ce
2 months ago
main (HEAD)
and
version 2
latest version
d4627b7d
10 commits,
16 hours ago
version 19
a03a55bc
10 commits,
2 months ago
version 18
43fd6495
9 commits,
2 months ago
version 17
7c54e032
8 commits,
2 months ago
version 16
7f439703
7 commits,
2 months ago
version 15
92db2c03
6 commits,
2 months ago
version 14
87203e75
5 commits,
2 months ago
version 13
0887cf86
5 commits,
2 months ago
version 12
bbe2c317
5 commits,
2 months ago
version 11
b82d0a51
4 commits,
2 months ago
version 10
a4cb8647
4 commits,
2 months ago
version 9
cfd9c222
4 commits,
2 months ago
version 8
4566fd04
4 commits,
2 months ago
version 7
b4bff5bd
3 commits,
2 months ago
version 6
b973edb0
2 commits,
2 months ago
version 5
e7ebcf43
3 commits,
2 months ago
version 4
b973edb0
2 commits,
2 months ago
version 3
0a9c9ed6
1 commit,
2 months ago
version 2
ea99dd5a
1 commit,
2 months ago
version 1
196bd9ce
1 commit,
2 months ago
Show latest version
1 file
+
14
−
0
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
src/data_handler.ts
+
14
−
0
Options
@@ -94,6 +94,20 @@ export class DataHandler {
ctx
.
log
.
info
(
`New transaction:
${
transfer
.
from
}
to
${
transfer
.
to
}
of
${
transfer
.
amount
}
tokens`
);
// should never fail because source of transfer must be an existing account
const
fromAccount
=
await
this
.
getAccountByAddressOrFail
(
ctx
,
transfer
.
from
);
// shoud never fail because destination of transfer must be existing account or raise System.NewAccount
const
toAccount
=
await
this
.
getAccountByAddressOrFail
(
ctx
,
transfer
.
to
);
const
newTransfer
=
new
Transfer
({
id
:
transfer
.
id
,
blockNumber
:
transfer
.
blockNumber
,
timestamp
:
transfer
.
timestamp
,
from
:
fromAccount
,
to
:
toAccount
,
amount
:
transfer
.
amount
,
});
this
.
data
.
transfers
.
set
(
transfer
.
id
,
newTransfer
);
// Update balances
await
this
.
updateAccountBalance
(
ctx
,
transfer
.
from
,
-
transfer
.
amount
);
await
this
.
updateAccountBalance
(
ctx
,
transfer
.
to
,
transfer
.
amount
);
Loading