Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
mybee
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
vicotor
mybee
Commits
9ff65caf
Unverified
Commit
9ff65caf
authored
Feb 06, 2021
by
Ralph Pichler
Committed by
GitHub
Feb 06, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
swap: fix storage keys (#1202)
parent
a6745006
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
11 additions
and
11 deletions
+11
-11
beekeeper.yml
.github/workflows/beekeeper.yml
+4
-4
slash-beekeeper.yml
.github/workflows/slash-beekeeper.yml
+4
-4
chequebook.go
pkg/settlement/swap/chequebook/chequebook.go
+2
-2
chequestore.go
pkg/settlement/swap/chequebook/chequestore.go
+1
-1
No files found.
.github/workflows/beekeeper.yml
View file @
9ff65caf
...
@@ -50,7 +50,7 @@ jobs:
...
@@ -50,7 +50,7 @@ jobs:
run
:
|
run
:
|
echo -e "127.0.0.10\tregistry.localhost" | sudo tee -a /etc/hosts
echo -e "127.0.0.10\tregistry.localhost" | sudo tee -a /etc/hosts
for ((i=0; i<REPLICA; i++)); do echo -e "127.0.1.$((i+1))\tbee-${i}.localhost bee-${i}-debug.localhost"; done | sudo tee -a /etc/hosts
for ((i=0; i<REPLICA; i++)); do echo -e "127.0.1.$((i+1))\tbee-${i}.localhost bee-${i}-debug.localhost"; done | sudo tee -a /etc/hosts
./beeinfra.sh install --local -r "${REPLICA}" --bootnode /dnsaddr/localhost --geth --k3s
./beeinfra.sh install --local -r "${REPLICA}" --bootnode /dnsaddr/localhost --geth --k3s
--pay-threshold 1000000000000
-
name
:
Test pingpong
-
name
:
Test pingpong
id
:
pingpong-1
id
:
pingpong-1
run
:
until ./beekeeper check pingpong --api-scheme http --debug-api-scheme http --disable-namespace --debug-api-domain localhost --api-domain localhost --node-count "${REPLICA}"; do echo "waiting for pingpong..."; sleep .3; done
run
:
until ./beekeeper check pingpong --api-scheme http --debug-api-scheme http --disable-namespace --debug-api-domain localhost --api-domain localhost --node-count "${REPLICA}"; do echo "waiting for pingpong..."; sleep .3; done
...
@@ -59,7 +59,7 @@ jobs:
...
@@ -59,7 +59,7 @@ jobs:
run
:
./beekeeper check fullconnectivity --api-scheme http --debug-api-scheme http --disable-namespace --debug-api-domain localhost --api-domain localhost --node-count "${REPLICA}"
run
:
./beekeeper check fullconnectivity --api-scheme http --debug-api-scheme http --disable-namespace --debug-api-domain localhost --api-domain localhost --node-count "${REPLICA}"
-
name
:
Test settlements
-
name
:
Test settlements
id
:
settlements-1
id
:
settlements-1
run
:
./beekeeper check settlements --api-scheme http --debug-api-scheme http --disable-namespace --debug-api-domain localhost --api-domain localhost --node-count "${REPLICA}" --upload-node-count "${REPLICA}"
run
:
./beekeeper check settlements --api-scheme http --debug-api-scheme http --disable-namespace --debug-api-domain localhost --api-domain localhost --node-count "${REPLICA}" --upload-node-count "${REPLICA}"
-t
1000000000000
-
name
:
Test pushsync (bytes)
-
name
:
Test pushsync (bytes)
id
:
pushsync-bytes-1
id
:
pushsync-bytes-1
run
:
./beekeeper check pushsync --api-scheme http --debug-api-scheme http --disable-namespace --debug-api-domain localhost --api-domain localhost --node-count "${REPLICA}" --upload-node-count "${REPLICA}" --chunks-per-node
3
run
:
./beekeeper check pushsync --api-scheme http --debug-api-scheme http --disable-namespace --debug-api-domain localhost --api-domain localhost --node-count "${REPLICA}" --upload-node-count "${REPLICA}" --chunks-per-node
3
...
@@ -96,7 +96,7 @@ jobs:
...
@@ -96,7 +96,7 @@ jobs:
cp /etc/rancher/k3s/k3s.yaml ~/.kube/config
cp /etc/rancher/k3s/k3s.yaml ~/.kube/config
-
name
:
Set testing cluster (Node connection and clef enabled)
-
name
:
Set testing cluster (Node connection and clef enabled)
run
:
|
run
:
|
./beeinfra.sh install --local -r "${REPLICA}" --geth --clef --k3s
./beeinfra.sh install --local -r "${REPLICA}" --geth --clef --k3s
--pay-threshold 1000000000000
-
name
:
Test pingpong
-
name
:
Test pingpong
id
:
pingpong-2
id
:
pingpong-2
run
:
until ./beekeeper check pingpong --api-scheme http --debug-api-scheme http --disable-namespace --debug-api-domain localhost --api-domain localhost --node-count "${REPLICA}"; do echo "waiting for pingpong..."; sleep .3; done
run
:
until ./beekeeper check pingpong --api-scheme http --debug-api-scheme http --disable-namespace --debug-api-domain localhost --api-domain localhost --node-count "${REPLICA}"; do echo "waiting for pingpong..."; sleep .3; done
...
@@ -105,7 +105,7 @@ jobs:
...
@@ -105,7 +105,7 @@ jobs:
run
:
./beekeeper check fullconnectivity --api-scheme http --debug-api-scheme http --disable-namespace --debug-api-domain localhost --api-domain localhost --node-count "${REPLICA}"
run
:
./beekeeper check fullconnectivity --api-scheme http --debug-api-scheme http --disable-namespace --debug-api-domain localhost --api-domain localhost --node-count "${REPLICA}"
-
name
:
Test settlements
-
name
:
Test settlements
id
:
settlements-2
id
:
settlements-2
run
:
./beekeeper check settlements --api-scheme http --debug-api-scheme http --disable-namespace --debug-api-domain localhost --api-domain localhost --node-count "${REPLICA}" --upload-node-count "${REPLICA}"
run
:
./beekeeper check settlements --api-scheme http --debug-api-scheme http --disable-namespace --debug-api-domain localhost --api-domain localhost --node-count "${REPLICA}" --upload-node-count "${REPLICA}"
-t
1000000000000
-
name
:
Test pushsync (bytes)
-
name
:
Test pushsync (bytes)
id
:
pushsync-bytes-2
id
:
pushsync-bytes-2
run
:
./beekeeper check pushsync --api-scheme http --debug-api-scheme http --disable-namespace --debug-api-domain localhost --api-domain localhost --node-count "${REPLICA}" --upload-node-count "${REPLICA}" --chunks-per-node
3
run
:
./beekeeper check pushsync --api-scheme http --debug-api-scheme http --disable-namespace --debug-api-domain localhost --api-domain localhost --node-count "${REPLICA}" --upload-node-count "${REPLICA}" --chunks-per-node
3
...
...
.github/workflows/slash-beekeeper.yml
View file @
9ff65caf
...
@@ -39,7 +39,7 @@ jobs:
...
@@ -39,7 +39,7 @@ jobs:
run
:
|
run
:
|
echo -e "127.0.0.10\tregistry.localhost" | sudo tee -a /etc/hosts
echo -e "127.0.0.10\tregistry.localhost" | sudo tee -a /etc/hosts
for ((i=0; i<REPLICA; i++)); do echo -e "127.0.1.$((i+1))\tbee-${i}.localhost bee-${i}-debug.localhost"; done | sudo tee -a /etc/hosts
for ((i=0; i<REPLICA; i++)); do echo -e "127.0.1.$((i+1))\tbee-${i}.localhost bee-${i}-debug.localhost"; done | sudo tee -a /etc/hosts
./beeinfra.sh install --dns-disco --local -r "${REPLICA}" --bootnode /dnsaddr/localhost --geth
./beeinfra.sh install --dns-disco --local -r "${REPLICA}" --bootnode /dnsaddr/localhost --geth
--pay-threshold 1000000000000
-
name
:
Test fullconnectivity
-
name
:
Test fullconnectivity
id
:
fullconnectivity-1
id
:
fullconnectivity-1
run
:
./beekeeper check fullconnectivity --api-scheme http --debug-api-scheme http --disable-namespace --debug-api-domain localhost --api-domain localhost --node-count "${REPLICA}"
run
:
./beekeeper check fullconnectivity --api-scheme http --debug-api-scheme http --disable-namespace --debug-api-domain localhost --api-domain localhost --node-count "${REPLICA}"
...
@@ -48,7 +48,7 @@ jobs:
...
@@ -48,7 +48,7 @@ jobs:
run
:
./beekeeper check pingpong --api-scheme http --debug-api-scheme http --disable-namespace --debug-api-domain localhost --api-domain localhost --node-count "${REPLICA}"
run
:
./beekeeper check pingpong --api-scheme http --debug-api-scheme http --disable-namespace --debug-api-domain localhost --api-domain localhost --node-count "${REPLICA}"
-
name
:
Test settlements
-
name
:
Test settlements
id
:
settlements-1
id
:
settlements-1
run
:
./beekeeper check settlements --api-scheme http --debug-api-scheme http --disable-namespace --debug-api-domain localhost --api-domain localhost --node-count "${REPLICA}" --upload-node-count "${REPLICA}"
run
:
./beekeeper check settlements --api-scheme http --debug-api-scheme http --disable-namespace --debug-api-domain localhost --api-domain localhost --node-count "${REPLICA}" --upload-node-count "${REPLICA}"
-t
1000000000000
-
name
:
Test pushsync (bytes)
-
name
:
Test pushsync (bytes)
id
:
pushsync-bytes-1
id
:
pushsync-bytes-1
run
:
./beekeeper check pushsync --api-scheme http --debug-api-scheme http --disable-namespace --debug-api-domain localhost --api-domain localhost --node-count "${REPLICA}" --upload-node-count "${REPLICA}" --chunks-per-node
3
run
:
./beekeeper check pushsync --api-scheme http --debug-api-scheme http --disable-namespace --debug-api-domain localhost --api-domain localhost --node-count "${REPLICA}" --upload-node-count "${REPLICA}" --chunks-per-node
3
...
@@ -82,7 +82,7 @@ jobs:
...
@@ -82,7 +82,7 @@ jobs:
cp $(k3d get-kubeconfig --name='k3s-default') ~/.kube/config
cp $(k3d get-kubeconfig --name='k3s-default') ~/.kube/config
-
name
:
Set testing cluster (Node connection and clef enabled)
-
name
:
Set testing cluster (Node connection and clef enabled)
run
:
|
run
:
|
./beeinfra.sh install --local -r "${REPLICA}" --geth --clef
./beeinfra.sh install --local -r "${REPLICA}" --geth --clef
--pay-threshold 1000000000000
-
name
:
Test fullconnectivity
-
name
:
Test fullconnectivity
id
:
fullconnectivity-2
id
:
fullconnectivity-2
run
:
./beekeeper check fullconnectivity --api-scheme http --debug-api-scheme http --disable-namespace --debug-api-domain localhost --api-domain localhost --node-count "${REPLICA}"
run
:
./beekeeper check fullconnectivity --api-scheme http --debug-api-scheme http --disable-namespace --debug-api-domain localhost --api-domain localhost --node-count "${REPLICA}"
...
@@ -91,7 +91,7 @@ jobs:
...
@@ -91,7 +91,7 @@ jobs:
run
:
./beekeeper check pingpong --api-scheme http --debug-api-scheme http --disable-namespace --debug-api-domain localhost --api-domain localhost --node-count "${REPLICA}"
run
:
./beekeeper check pingpong --api-scheme http --debug-api-scheme http --disable-namespace --debug-api-domain localhost --api-domain localhost --node-count "${REPLICA}"
-
name
:
Test settlements
-
name
:
Test settlements
id
:
settlements-2
id
:
settlements-2
run
:
./beekeeper check settlements --api-scheme http --debug-api-scheme http --disable-namespace --debug-api-domain localhost --api-domain localhost --node-count "${REPLICA}" --upload-node-count "${REPLICA}"
run
:
./beekeeper check settlements --api-scheme http --debug-api-scheme http --disable-namespace --debug-api-domain localhost --api-domain localhost --node-count "${REPLICA}" --upload-node-count "${REPLICA}"
-t
1000000000000
-
name
:
Test pushsync (bytes)
-
name
:
Test pushsync (bytes)
id
:
pushsync-bytes-2
id
:
pushsync-bytes-2
run
:
./beekeeper check pushsync --api-scheme http --debug-api-scheme http --disable-namespace --debug-api-domain localhost --api-domain localhost --node-count "${REPLICA}" --upload-node-count "${REPLICA}" --chunks-per-node
3
run
:
./beekeeper check pushsync --api-scheme http --debug-api-scheme http --disable-namespace --debug-api-domain localhost --api-domain localhost --node-count "${REPLICA}" --upload-node-count "${REPLICA}" --chunks-per-node
3
...
...
pkg/settlement/swap/chequebook/chequebook.go
View file @
9ff65caf
...
@@ -24,7 +24,7 @@ import (
...
@@ -24,7 +24,7 @@ import (
type
SendChequeFunc
func
(
cheque
*
SignedCheque
)
error
type
SendChequeFunc
func
(
cheque
*
SignedCheque
)
error
const
(
const
(
lastIssuedChequeKeyPrefix
=
"swap_chequebook_last_issued_cheque"
lastIssuedChequeKeyPrefix
=
"swap_chequebook_last_issued_cheque
_
"
totalIssuedKey
=
"swap_chequebook_total_issued_"
totalIssuedKey
=
"swap_chequebook_total_issued_"
)
)
...
@@ -201,7 +201,7 @@ func (s *service) WaitForDeposit(ctx context.Context, txHash common.Hash) error
...
@@ -201,7 +201,7 @@ func (s *service) WaitForDeposit(ctx context.Context, txHash common.Hash) error
// lastIssuedChequeKey computes the key where to store the last cheque for a beneficiary.
// lastIssuedChequeKey computes the key where to store the last cheque for a beneficiary.
func
lastIssuedChequeKey
(
beneficiary
common
.
Address
)
string
{
func
lastIssuedChequeKey
(
beneficiary
common
.
Address
)
string
{
return
fmt
.
Sprintf
(
"%s
_
%x"
,
lastIssuedChequeKeyPrefix
,
beneficiary
)
return
fmt
.
Sprintf
(
"%s%x"
,
lastIssuedChequeKeyPrefix
,
beneficiary
)
}
}
func
(
s
*
service
)
reserveTotalIssued
(
ctx
context
.
Context
,
amount
*
big
.
Int
)
(
*
big
.
Int
,
error
)
{
func
(
s
*
service
)
reserveTotalIssued
(
ctx
context
.
Context
,
amount
*
big
.
Int
)
(
*
big
.
Int
,
error
)
{
...
...
pkg/settlement/swap/chequebook/chequestore.go
View file @
9ff65caf
...
@@ -222,7 +222,7 @@ func keyChequebook(key []byte, prefix string) (chequebook common.Address, err er
...
@@ -222,7 +222,7 @@ func keyChequebook(key []byte, prefix string) (chequebook common.Address, err er
func
(
s
*
chequeStore
)
LastCheques
()
(
map
[
common
.
Address
]
*
SignedCheque
,
error
)
{
func
(
s
*
chequeStore
)
LastCheques
()
(
map
[
common
.
Address
]
*
SignedCheque
,
error
)
{
result
:=
make
(
map
[
common
.
Address
]
*
SignedCheque
)
result
:=
make
(
map
[
common
.
Address
]
*
SignedCheque
)
err
:=
s
.
store
.
Iterate
(
lastReceivedChequePrefix
,
func
(
key
,
val
[]
byte
)
(
stop
bool
,
err
error
)
{
err
:=
s
.
store
.
Iterate
(
lastReceivedChequePrefix
,
func
(
key
,
val
[]
byte
)
(
stop
bool
,
err
error
)
{
addr
,
err
:=
keyChequebook
(
key
,
lastReceivedChequePrefix
)
addr
,
err
:=
keyChequebook
(
key
,
lastReceivedChequePrefix
+
"_"
)
if
err
!=
nil
{
if
err
!=
nil
{
return
false
,
fmt
.
Errorf
(
"parse address from key: %s: %w"
,
string
(
key
),
err
)
return
false
,
fmt
.
Errorf
(
"parse address from key: %s: %w"
,
string
(
key
),
err
)
}
}
...
...
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