Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
G
Goshimmer_without_tipselection
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
Container registry
Model registry
Operate
Environments
Monitor
Incidents
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
COLLET Ismael
Goshimmer_without_tipselection
Commits
b19a815d
Commit
b19a815d
authored
5 years ago
by
Luca Moser
Browse files
Options
Downloads
Patches
Plain Diff
fixes relay-chcker tool
parent
d08572be
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
tools/relay-checker/main.go
+6
-9
6 additions, 9 deletions
tools/relay-checker/main.go
with
6 additions
and
9 deletions
tools/relay-checker/main.go
+
6
−
9
View file @
b19a815d
...
@@ -5,23 +5,21 @@ import (
...
@@ -5,23 +5,21 @@ import (
"time"
"time"
client
"github.com/iotaledger/goshimmer/client"
client
"github.com/iotaledger/goshimmer/client"
"github.com/iotaledger/goshimmer/packages/errors"
"github.com/iotaledger/iota.go/trinary"
"github.com/iotaledger/iota.go/trinary"
)
)
func
testBroadcastData
(
api
*
client
.
GoShimmerAPI
)
(
trinary
.
Hash
,
error
)
{
func
testBroadcastData
(
api
*
client
.
GoShimmerAPI
)
(
trinary
.
Hash
,
error
)
{
txnHash
,
err
:=
api
.
BroadcastData
(
txnAddr
,
txnData
)
txnHash
,
err
:=
api
.
BroadcastData
(
txnAddr
,
txnData
)
if
err
!=
nil
{
if
err
!=
nil
{
return
""
,
errors
.
Wrapf
(
err
,
"B
roadcast failed
"
)
return
""
,
fmt
.
Errorf
(
"b
roadcast failed
: %w"
,
err
)
}
}
return
txnHash
,
nil
return
txnHash
,
nil
}
}
func
testTargetGetTransactions
(
api
*
client
.
GoShimmerAPI
,
txnHash
trinary
.
Hash
)
error
{
func
testTargetGetTransactions
(
api
*
client
.
GoShimmerAPI
,
txnHash
trinary
.
Hash
)
error
{
// query target node for broadcasted data
// query target node for broadcasted data
_
,
err
:=
api
.
GetTransactionObjectsByHash
([]
trinary
.
Hash
{
txnHash
})
if
_
,
err
:=
api
.
GetTransactionObjectsByHash
([]
trinary
.
Hash
{
txnHash
});
err
!=
nil
{
if
err
!=
nil
{
return
fmt
.
Errorf
(
"querying the target node failed: %w"
,
err
)
return
errors
.
Wrapf
(
err
,
"Query target failed"
)
}
}
return
nil
return
nil
}
}
...
@@ -30,11 +28,10 @@ func testNodesGetTransactions(txnHash trinary.Hash) error {
...
@@ -30,11 +28,10 @@ func testNodesGetTransactions(txnHash trinary.Hash) error {
// query nodes node for broadcasted data
// query nodes node for broadcasted data
for
_
,
n
:=
range
nodes
{
for
_
,
n
:=
range
nodes
{
nodesApi
:=
client
.
NewGoShimmerAPI
(
n
)
nodesApi
:=
client
.
NewGoShimmerAPI
(
n
)
_
,
err
:=
nodesApi
.
GetTransactionObjectsByHash
([]
trinary
.
Hash
{
txnHash
})
if
_
,
err
:=
nodesApi
.
GetTransactionObjectsByHash
([]
trinary
.
Hash
{
txnHash
});
err
!=
nil
{
if
err
!=
nil
{
return
fmt
.
Errorf
(
"querying node %s failed: %w"
,
n
,
err
)
return
errors
.
Wrapf
(
err
,
"Query %s failed"
,
n
)
}
}
fmt
.
Printf
(
"txn found in %s
\n
"
,
n
)
fmt
.
Printf
(
"txn found in
node
%s
\n
"
,
n
)
}
}
return
nil
return
nil
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment