Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
hive-ruby
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
hive
hive-ruby
Commits
ea045736
Commit
ea045736
authored
6 years ago
by
Anthony Martin
Browse files
Options
Downloads
Patches
Plain Diff
deep comparison test between appbase and condenser results
parent
159a5db6
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
test/steem/block_api_test.rb
+52
-0
52 additions, 0 deletions
test/steem/block_api_test.rb
with
52 additions
and
0 deletions
test/steem/block_api_test.rb
+
52
−
0
View file @
ea045736
...
@@ -76,5 +76,57 @@ module Steem
...
@@ -76,5 +76,57 @@ module Steem
end
end
end
end
end
end
def
test_oddballs
oddballs
=
[
994240
]
api
=
Steem
::
Api
.
new
(
url:
TEST_NODE
)
vcr_cassette
(
'block_api_oddballs'
,
record: :once
)
do
oddballs
.
each
do
|
block_num
|
@block_api
.
get_block
(
block_num:
block_num
)
do
|
b1
|
b1
=
b1
.
block
api
.
get_block
(
block_num
)
do
|
b2
|
b2
.
keys
.
each
do
|
key
|
case
key
.
to_sym
when
:transactions
b2
[
:transactions
].
each_with_index
do
|
trx2
,
trx_index
|
trx1
=
b1
[
:transactions
][
trx_index
]
trx2
.
keys
.
each
do
|
key
|
case
key
.
to_sym
when
:operations
trx2
[
:operations
].
each_with_index
do
|
op1
,
op_index
|
op2
=
trx2
[
:operations
][
op_index
]
op1
[
1
].
keys
.
each
do
|
key
|
case
key
.
to_sym
when
:fee
fee1
=
Type
::
Amount
.
new
(
op1
[
1
][
:fee
])
fee2
=
Type
::
Amount
.
new
(
op2
[
1
][
:fee
])
assert_equal
fee2
.
to_nia
,
fee1
.
to_nia
,
"expect the same fee"
else
assert_equal
op2
[
1
][
key
],
op1
[
1
][
key
],
"expect the same operation
#{
key
}
"
end
end
end
when
:transaction_id
,
:block_num
,
:transaction_num
assert_nil
trx1
[
key
],
"did not expect nil
#{
key
}
"
refute_nil
trx2
[
key
],
"expect nil
#{
key
}
"
else
assert_equal
trx2
[
key
],
trx1
[
key
],
"expect the same transaction
#{
key
}
"
end
end
end
else
assert_equal
b2
[
key
],
b1
[
key
],
"expect the same
#{
key
}
"
end
end
end
end
end
end
end
end
end
end
end
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