Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
Geth-Modification
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
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
张蕾
Geth-Modification
Commits
a1c0bb68
Commit
a1c0bb68
authored
Jan 16, 2015
by
Marek Kotewicz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed checking first bit for parsing int output
parent
774e9d24
Changes
4
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
13 additions
and
7 deletions
+13
-7
ethereum.js
dist/ethereum.js
+5
-2
ethereum.js.map
dist/ethereum.js.map
+2
-2
ethereum.min.js
dist/ethereum.min.js
+1
-1
abi.js
lib/abi.js
+5
-2
No files found.
dist/ethereum.js
View file @
a1c0bb68
...
...
@@ -90,7 +90,7 @@ var setupInputTypes = function () {
/// Formats input value to byte representation of int
/// If value is negative, return it's two's complement
/// If the value is floating point,
it rounds
it down
/// If the value is floating point,
round
it down
/// @returns right-aligned byte representation of int
var
formatInt
=
function
(
value
)
{
var
padding
=
32
*
2
;
...
...
@@ -178,12 +178,15 @@ var setupOutputTypes = function () {
var
formatInt
=
function
(
value
)
{
// check if it's negative number
// it it is, return two's complement
if
(
value
.
substr
(
0
,
1
).
toLowerCase
()
===
'f'
)
{
var
firstBit
=
new
BigNumber
(
value
.
substr
(
0
,
1
),
16
).
toString
(
2
).
substr
(
0
,
1
);
if
(
firstBit
===
'1'
)
{
return
new
BigNumber
(
value
,
16
).
minus
(
new
BigNumber
(
'ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff'
,
16
)).
minus
(
1
);
}
return
new
BigNumber
(
value
,
16
);
};
/// Formats big right-aligned input bytes to uint
/// @returns right-aligned input bytes formatted to uint
var
formatUInt
=
function
(
value
)
{
return
new
BigNumber
(
value
,
16
);
};
...
...
dist/ethereum.js.map
View file @
a1c0bb68
This diff is collapsed.
Click to expand it.
dist/ethereum.min.js
View file @
a1c0bb68
This diff is collapsed.
Click to expand it.
lib/abi.js
View file @
a1c0bb68
...
...
@@ -89,7 +89,7 @@ var setupInputTypes = function () {
/// Formats input value to byte representation of int
/// If value is negative, return it's two's complement
/// If the value is floating point,
it rounds
it down
/// If the value is floating point,
round
it down
/// @returns right-aligned byte representation of int
var
formatInt
=
function
(
value
)
{
var
padding
=
32
*
2
;
...
...
@@ -177,12 +177,15 @@ var setupOutputTypes = function () {
var
formatInt
=
function
(
value
)
{
// check if it's negative number
// it it is, return two's complement
if
(
value
.
substr
(
0
,
1
).
toLowerCase
()
===
'f'
)
{
var
firstBit
=
new
BigNumber
(
value
.
substr
(
0
,
1
),
16
).
toString
(
2
).
substr
(
0
,
1
);
if
(
firstBit
===
'1'
)
{
return
new
BigNumber
(
value
,
16
).
minus
(
new
BigNumber
(
'ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff'
,
16
)).
minus
(
1
);
}
return
new
BigNumber
(
value
,
16
);
};
/// Formats big right-aligned input bytes to uint
/// @returns right-aligned input bytes formatted to uint
var
formatUInt
=
function
(
value
)
{
return
new
BigNumber
(
value
,
16
);
};
...
...
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