Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
N
nebula
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
exchain
nebula
Commits
58a5d436
Commit
58a5d436
authored
Feb 05, 2025
by
vicotor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add exchain define
parent
145b3643
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
19 additions
and
6 deletions
+19
-6
account.go
exchain/account.go
+4
-0
db.go
exchain/db.go
+11
-0
transaction.go
exchain/transaction.go
+2
-4
types.go
exchain/types.go
+2
-2
No files found.
exchain/account.go
View file @
58a5d436
...
@@ -8,6 +8,10 @@ type Wallet struct {
...
@@ -8,6 +8,10 @@ type Wallet struct {
FrozenBalance
uint256
.
Int
`json:"frozenBalance"`
FrozenBalance
uint256
.
Int
`json:"frozenBalance"`
}
}
func
(
w
*
Wallet
)
AddBalance
(
balance
uint256
.
Int
)
{
w
.
Balance
=
*
new
(
uint256
.
Int
)
.
Add
(
&
w
.
Balance
,
&
balance
)
}
type
ProxyPublickey
[
64
]
byte
type
ProxyPublickey
[
64
]
byte
type
AccountInfo
struct
{
type
AccountInfo
struct
{
...
...
exchain/db.go
View file @
58a5d436
...
@@ -14,4 +14,15 @@ type StateDB interface {
...
@@ -14,4 +14,15 @@ type StateDB interface {
}
}
type
ChainDB
interface
{
type
ChainDB
interface
{
AddCoin
()
GetCoin
()
AddPair
()
GetPair
()
}
}
// todo: tx press test.
// limit, market, cancel 100w, each block 10w.
// serialize and unserialize.
// todo: add new struct.
// define Coin, Pair struct to store at chaindb.
// todo: define detail tx struct.
exchain/transaction.go
View file @
58a5d436
...
@@ -51,13 +51,11 @@ type DepositTxData struct {
...
@@ -51,13 +51,11 @@ type DepositTxData struct {
// From is exposed through the types.Signer, not through TxData
// From is exposed through the types.Signer, not through TxData
From
common
.
Address
From
common
.
Address
// nil means contract creation
// nil means contract creation
To
*
common
.
Address
`rlp:"nil"`
To
*
common
.
Address
// Mint is minted on L2, locked on L1, nil if no minting.
// Mint is minted on L2, locked on L1, nil if no minting.
Mint
*
big
.
Int
`rlp:"nil"`
Mint
*
big
.
Int
// Value is transferred from L2 balance, executed after Mint (if any)
// Value is transferred from L2 balance, executed after Mint (if any)
Value
*
big
.
Int
Value
*
big
.
Int
// gas limit
Gas
uint64
// Field indicating if this transaction is exempt from the L2 gas limit.
// Field indicating if this transaction is exempt from the L2 gas limit.
IsSystemTransaction
bool
IsSystemTransaction
bool
// Normal Tx data
// Normal Tx data
...
...
exchain/types.go
View file @
58a5d436
...
@@ -13,5 +13,5 @@ type BlockHeader struct {
...
@@ -13,5 +13,5 @@ type BlockHeader struct {
Proposer
common
.
Address
Proposer
common
.
Address
}
}
type
BlockBody
struct
{
type
Coin
struct
{}
}
type
ExPair
struct
{
}
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