Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
plugin
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
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
link33
plugin
Commits
ce2ba241
Commit
ce2ba241
authored
Mar 27, 2020
by
harrylee
Committed by
vipwzw
Apr 04, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update proto.version
parent
993afda5
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
10 additions
and
7 deletions
+10
-7
account_test.go
plugin/dapp/accountmanager/executor/account_test.go
+3
-3
accountdb.go
plugin/dapp/accountmanager/executor/accountdb.go
+1
-1
accountmanager.go
plugin/dapp/accountmanager/executor/accountmanager.go
+4
-1
tables_test.go
plugin/dapp/accountmanager/executor/tables_test.go
+2
-2
accountmanager.pb.go
plugin/dapp/accountmanager/types/accountmanager.pb.go
+0
-0
No files found.
plugin/dapp/accountmanager/executor/account_test.go
View file @
ce2ba241
...
@@ -185,10 +185,10 @@ func TestAccountManager(t *testing.T) {
...
@@ -185,10 +185,10 @@ func TestAccountManager(t *testing.T) {
assert
.
Equal
(
t
,
balance
.
Balance
,
199
*
types
.
Coin
)
assert
.
Equal
(
t
,
balance
.
Balance
,
199
*
types
.
Coin
)
//过期账户查询
//过期账户查询
time
.
Sleep
(
1
0
*
time
.
Second
)
time
.
Sleep
(
1
1
*
time
.
Second
)
accounts
,
err
=
Exec_QueryExpiredAccounts
(
time
.
Now
()
.
Unix
(),
stateDB
,
kvdb
)
accounts
,
err
=
Exec_QueryExpiredAccounts
(
time
.
Now
()
.
Unix
(),
stateDB
,
kvdb
)
assert
.
Equal
(
t
,
err
,
nil
)
assert
.
Equal
(
t
,
err
,
nil
)
assert
.
Equal
(
t
,
accounts
.
Accounts
[
0
]
.
AccountID
,
"harrylee2015"
)
assert
.
Equal
(
t
,
2
,
len
(
accounts
.
Accounts
)
)
//账户延期
//账户延期
tx10
,
_
:=
CreateSupervise
(
&
et
.
Supervise
{
tx10
,
_
:=
CreateSupervise
(
&
et
.
Supervise
{
AccountIDs
:
[]
string
{
"harrylee2015"
},
AccountIDs
:
[]
string
{
"harrylee2015"
},
...
@@ -198,7 +198,7 @@ func TestAccountManager(t *testing.T) {
...
@@ -198,7 +198,7 @@ func TestAccountManager(t *testing.T) {
assert
.
Equal
(
t
,
err
,
nil
)
assert
.
Equal
(
t
,
err
,
nil
)
accounts
,
err
=
Exec_QueryExpiredAccounts
(
time
.
Now
()
.
Unix
(),
stateDB
,
kvdb
)
accounts
,
err
=
Exec_QueryExpiredAccounts
(
time
.
Now
()
.
Unix
(),
stateDB
,
kvdb
)
assert
.
Equal
(
t
,
err
,
nil
)
assert
.
Equal
(
t
,
err
,
nil
)
assert
.
Equal
(
t
,
len
(
accounts
.
Accounts
),
0
)
assert
.
Equal
(
t
,
1
,
len
(
accounts
.
Accounts
)
)
//账户授权
//账户授权
tx11
,
_
:=
CreateSupervise
(
&
et
.
Supervise
{
tx11
,
_
:=
CreateSupervise
(
&
et
.
Supervise
{
AccountIDs
:
[]
string
{
"harrylee2015"
},
AccountIDs
:
[]
string
{
"harrylee2015"
},
...
...
plugin/dapp/accountmanager/executor/accountdb.go
View file @
ce2ba241
...
@@ -427,7 +427,7 @@ func findAccountByAddr(localdb dbm.KV, addr string) (*et.Account, error) {
...
@@ -427,7 +427,7 @@ func findAccountByAddr(localdb dbm.KV, addr string) (*et.Account, error) {
//第一次查询,默认展示最新得成交记录
//第一次查询,默认展示最新得成交记录
rows
,
err
:=
table
.
ListIndex
(
"addr"
,
prefix
,
nil
,
1
,
et
.
ListDESC
)
rows
,
err
:=
table
.
ListIndex
(
"addr"
,
prefix
,
nil
,
1
,
et
.
ListDESC
)
if
err
!=
nil
{
if
err
!=
nil
{
elog
.
Error
(
"findAccountByAddr."
,
"
prefix"
,
prefix
,
"err"
,
err
.
Error
())
elog
.
Error
(
"findAccountByAddr."
,
"
addr"
,
addr
,
"err"
,
err
.
Error
())
return
nil
,
err
return
nil
,
err
}
}
for
_
,
row
:=
range
rows
{
for
_
,
row
:=
range
rows
{
...
...
plugin/dapp/accountmanager/executor/accountmanager.go
View file @
ce2ba241
...
@@ -60,7 +60,10 @@ func (a *Accountmanager) ExecutorOrder() int64 {
...
@@ -60,7 +60,10 @@ func (a *Accountmanager) ExecutorOrder() int64 {
func
(
a
*
Accountmanager
)
CheckTx
(
tx
*
types
.
Transaction
,
index
int
)
error
{
func
(
a
*
Accountmanager
)
CheckTx
(
tx
*
types
.
Transaction
,
index
int
)
error
{
//发送交易的时候就检查payload,做严格的参数检查
//发送交易的时候就检查payload,做严格的参数检查
var
ama
et
.
AccountmanagerAction
var
ama
et
.
AccountmanagerAction
types
.
Decode
(
tx
.
GetPayload
(),
&
ama
)
err
:=
types
.
Decode
(
tx
.
GetPayload
(),
&
ama
)
if
err
!=
nil
{
return
err
}
switch
ama
.
Ty
{
switch
ama
.
Ty
{
case
et
.
TyRegisterAction
:
case
et
.
TyRegisterAction
:
register
:=
ama
.
GetRegister
()
register
:=
ama
.
GetRegister
()
...
...
plugin/dapp/accountmanager/executor/tables_test.go
View file @
ce2ba241
...
@@ -13,8 +13,8 @@ func TestAccountTable(t *testing.T) {
...
@@ -13,8 +13,8 @@ func TestAccountTable(t *testing.T) {
_
,
_
,
kvdb
:=
util
.
CreateTestDB
()
_
,
_
,
kvdb
:=
util
.
CreateTestDB
()
table
:=
NewAccountTable
(
kvdb
)
table
:=
NewAccountTable
(
kvdb
)
now
:=
time
.
Now
()
.
Unix
()
now
:=
time
.
Now
()
.
Unix
()
row1
:=
&
et
.
Account
{
Index
:
now
*
int64
(
types
.
MaxTxsPerBlock
),
AccountID
:
"harry2015"
,
Status
:
1
,
ExpireTime
:
now
+
10
,
Addr
:
"xxxx"
}
row1
:=
&
et
.
Account
{
Index
:
now
*
int64
(
types
.
MaxTxsPerBlock
),
AccountID
:
"harry2015"
,
Status
:
0
,
ExpireTime
:
now
+
10
,
Addr
:
"xxxx"
}
row2
:=
&
et
.
Account
{
Index
:
now
*
int64
(
types
.
MaxTxsPerBlock
)
+
1
,
AccountID
:
"harry2020"
,
Status
:
1
,
ExpireTime
:
now
,
Addr
:
"xxxx"
}
row2
:=
&
et
.
Account
{
Index
:
now
*
int64
(
types
.
MaxTxsPerBlock
)
+
1
,
AccountID
:
"harry2020"
,
Status
:
0
,
ExpireTime
:
now
,
Addr
:
"xxxx"
}
table
.
Add
(
row1
)
table
.
Add
(
row1
)
table
.
Add
(
row2
)
table
.
Add
(
row2
)
kvs
,
err
:=
table
.
Save
()
kvs
,
err
:=
table
.
Save
()
...
...
plugin/dapp/accountmanager/types/accountmanager.pb.go
View file @
ce2ba241
This diff is collapsed.
Click to expand it.
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