Skip to content

Commit

Permalink
Merge 13daf3f into 5ce495a
Browse files Browse the repository at this point in the history
  • Loading branch information
elvis88 committed Mar 20, 2019
2 parents 5ce495a + 13daf3f commit 349efc8
Show file tree
Hide file tree
Showing 93 changed files with 3,457 additions and 2,624 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
# git config --global core.excludesfile ~/.gitignore_global
build/bin
build/_workspace
build/test_sdk

*.bak

Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ ftfinder:
clean:
rm -rf build/bin build/_workspace

test:
test: all
./build/env.sh ./test.sh

.PHONY: all clean test ftfinder ft ftkey ftfinder
2 changes: 1 addition & 1 deletion accountmanager/account.go
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ func (a *Account) GetBalanceByID(assetID uint64) (*big.Int, error) {
if p, find := a.binarySearch(assetID); find == true {
return a.Balances[p].Balance, nil
}
log.Debug("asset not exist", "account", "asset", ErrAccountAssetNotExist, a.AcctName, assetID)
log.Debug("get balance by ID", "err", ErrAccountAssetNotExist, "account", a.AcctName, "asset", assetID)
return big.NewInt(0), ErrAccountAssetNotExist
}

Expand Down
48 changes: 24 additions & 24 deletions accountmanager/account_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ func Test_newAssetBalance(t *testing.T) {
args args
want *AssetBalance
}{
// TODO: Add test cases.
// TODO: Add test cases.
}
for _, tt := range tests {
if got := newAssetBalance(tt.args.assetID, tt.args.amount); !reflect.DeepEqual(got, tt.want) {
Expand All @@ -55,7 +55,7 @@ func TestNewAccount(t *testing.T) {
want *Account
wantErr bool
}{
// TODO: Add test cases.
// TODO: Add test cases.
}
for _, tt := range tests {
got, err := NewAccount(tt.args.accountName, tt.args.founderName, tt.args.pubkey)
Expand Down Expand Up @@ -86,7 +86,7 @@ func TestAccount_GetName(t *testing.T) {
fields fields
want common.Name
}{
// TODO: Add test cases.
// TODO: Add test cases.
}
for _, tt := range tests {
a := &Account{
Expand Down Expand Up @@ -123,7 +123,7 @@ func TestAccount_GetNonce(t *testing.T) {
fields fields
want uint64
}{
// TODO: Add test cases.
// TODO: Add test cases.
}
for _, tt := range tests {
a := &Account{
Expand Down Expand Up @@ -163,7 +163,7 @@ func TestAccount_SetNonce(t *testing.T) {
fields fields
args args
}{
// TODO: Add test cases.
// TODO: Add test cases.
}
for _, tt := range tests {
a := &Account{
Expand Down Expand Up @@ -198,7 +198,7 @@ func TestAccount_GetPubKey(t *testing.T) {
fields fields
want common.PubKey
}{
// TODO: Add test cases.
// TODO: Add test cases.
}
for _, tt := range tests {
a := &Account{
Expand Down Expand Up @@ -238,7 +238,7 @@ func TestAccount_SetPubKey(t *testing.T) {
fields fields
args args
}{
// TODO: Add test cases.
// TODO: Add test cases.
}
for _, tt := range tests {
a := &Account{
Expand Down Expand Up @@ -274,7 +274,7 @@ func TestAccount_GetCode(t *testing.T) {
want []byte
wantErr bool
}{
// TODO: Add test cases.
// TODO: Add test cases.
}
for _, tt := range tests {
a := &Account{
Expand Down Expand Up @@ -316,7 +316,7 @@ func TestAccount_GetCodeSize(t *testing.T) {
fields fields
want uint64
}{
// TODO: Add test cases.
// TODO: Add test cases.
}
for _, tt := range tests {
a := &Account{
Expand Down Expand Up @@ -357,7 +357,7 @@ func TestAccount_SetCode(t *testing.T) {
args args
wantErr bool
}{
// TODO: Add test cases.
// TODO: Add test cases.
}
for _, tt := range tests {
a := &Account{
Expand Down Expand Up @@ -395,7 +395,7 @@ func TestAccount_GetCodeHash(t *testing.T) {
want common.Hash
wantErr bool
}{
// TODO: Add test cases.
// TODO: Add test cases.
}
for _, tt := range tests {
a := &Account{
Expand Down Expand Up @@ -442,7 +442,7 @@ func TestAccount_GetBalanceByID(t *testing.T) {
want *big.Int
wantErr bool
}{
// TODO: Add test cases.
// TODO: Add test cases.
}
for _, tt := range tests {
a := &Account{
Expand Down Expand Up @@ -484,7 +484,7 @@ func TestAccount_GetBalancesList(t *testing.T) {
fields fields
want []*AssetBalance
}{
// TODO: Add test cases.
// TODO: Add test cases.
}
for _, tt := range tests {
a := &Account{
Expand Down Expand Up @@ -522,7 +522,7 @@ func TestAccount_GetAllBalances(t *testing.T) {
want map[uint64]*big.Int
wantErr bool
}{
// TODO: Add test cases.
// TODO: Add test cases.
}
for _, tt := range tests {
a := &Account{
Expand Down Expand Up @@ -569,7 +569,7 @@ func TestAccount_binarySearch(t *testing.T) {
want int64
want1 bool
}{
// TODO: Add test cases.
// TODO: Add test cases.
}
for _, tt := range tests {
a := &Account{
Expand Down Expand Up @@ -614,7 +614,7 @@ func TestAccount_AddNewAssetByAssetID(t *testing.T) {
fields fields
args args
}{
// TODO: Add test cases.
// TODO: Add test cases.
}

for _, tt := range tests {
Expand Down Expand Up @@ -655,7 +655,7 @@ func TestAccount_SetBalance(t *testing.T) {
args args
wantErr bool
}{
// TODO: Add test cases.
// TODO: Add test cases.
}
for _, tt := range tests {
a := &Account{
Expand Down Expand Up @@ -697,7 +697,7 @@ func TestAccount_SubBalanceByID(t *testing.T) {
args args
wantErr bool
}{
// TODO: Add test cases.
// TODO: Add test cases.
}
for _, tt := range tests {
a := &Account{
Expand Down Expand Up @@ -739,7 +739,7 @@ func TestAccount_AddBalanceByID(t *testing.T) {
args args
wantErr bool
}{
// TODO: Add test cases.
// TODO: Add test cases.
}
for _, tt := range tests {
a := &Account{
Expand Down Expand Up @@ -781,7 +781,7 @@ func TestAccount_EnoughAccountBalance(t *testing.T) {
args args
wantErr bool
}{
// TODO: Add test cases.
// TODO: Add test cases.
}
for _, tt := range tests {
a := &Account{
Expand Down Expand Up @@ -818,7 +818,7 @@ func TestAccount_IsSuicided(t *testing.T) {
fields fields
want bool
}{
// TODO: Add test cases.
// TODO: Add test cases.
}
for _, tt := range tests {
a := &Account{
Expand Down Expand Up @@ -854,7 +854,7 @@ func TestAccount_SetSuicide(t *testing.T) {
name string
fields fields
}{
// TODO: Add test cases.
// TODO: Add test cases.
}
for _, tt := range tests {
a := &Account{
Expand Down Expand Up @@ -889,7 +889,7 @@ func TestAccount_IsDestroyed(t *testing.T) {
fields fields
want bool
}{
// TODO: Add test cases.
// TODO: Add test cases.
}
for _, tt := range tests {
a := &Account{
Expand Down Expand Up @@ -925,7 +925,7 @@ func TestAccount_SetDestroy(t *testing.T) {
name string
fields fields
}{
// TODO: Add test cases.
// TODO: Add test cases.
}
for _, tt := range tests {
a := &Account{
Expand Down
2 changes: 1 addition & 1 deletion accountmanager/accountmanager.go
Original file line number Diff line number Diff line change
Expand Up @@ -913,7 +913,7 @@ func (am *AccountManager) process(action *types.Action) error {
if action.Recipient() != common.Name(sysName) {
return ErrToNameInvalid
}
} else {
} else if action.Type() != types.Transfer {
return ErrAmountValueInvalid
}

Expand Down
2 changes: 1 addition & 1 deletion accountmanager/accountmanager_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ func TestNewAccountManager(t *testing.T) {
}

func TestAccountManager_InitAccountCounter(t *testing.T) {
//TODO
//TODO
}

func TestAccountManager_CreateAccount(t *testing.T) {
Expand Down
22 changes: 11 additions & 11 deletions asset/asset_object_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -154,8 +154,8 @@ func TestAssetObject_GetSymbol(t *testing.T) {
fields fields
want string
}{
// TODO: Add test cases.
// {"getexist",fields{}}
// TODO: Add test cases.
// {"getexist",fields{}}
}
for _, tt := range tests {
ao := &AssetObject{
Expand Down Expand Up @@ -189,7 +189,7 @@ func TestAssetObject_SetSymbol(t *testing.T) {
fields fields
args args
}{
// TODO: Add test cases.
// TODO: Add test cases.
}
for _, tt := range tests {
ao := &AssetObject{
Expand Down Expand Up @@ -218,7 +218,7 @@ func TestAssetObject_GetDecimals(t *testing.T) {
fields fields
want uint64
}{
// TODO: Add test cases.
// TODO: Add test cases.
}
for _, tt := range tests {
ao := &AssetObject{
Expand Down Expand Up @@ -252,7 +252,7 @@ func TestAssetObject_SetDecimals(t *testing.T) {
fields fields
args args
}{
// TODO: Add test cases.
// TODO: Add test cases.
}
for _, tt := range tests {
ao := &AssetObject{
Expand Down Expand Up @@ -281,7 +281,7 @@ func TestAssetObject_GetAssetName(t *testing.T) {
fields fields
want string
}{
// TODO: Add test cases.
// TODO: Add test cases.
}
for _, tt := range tests {
ao := &AssetObject{
Expand Down Expand Up @@ -315,7 +315,7 @@ func TestAssetObject_SetAssetName(t *testing.T) {
fields fields
args args
}{
// TODO: Add test cases.
// TODO: Add test cases.
}
for _, tt := range tests {
ao := &AssetObject{
Expand Down Expand Up @@ -344,7 +344,7 @@ func TestAssetObject_GetAssetAmount(t *testing.T) {
fields fields
want *big.Int
}{
// TODO: Add test cases.
// TODO: Add test cases.
}
for _, tt := range tests {
ao := &AssetObject{
Expand Down Expand Up @@ -378,7 +378,7 @@ func TestAssetObject_SetAssetAmount(t *testing.T) {
fields fields
args args
}{
// TODO: Add test cases.
// TODO: Add test cases.
}
for _, tt := range tests {
ao := &AssetObject{
Expand Down Expand Up @@ -407,7 +407,7 @@ func TestAssetObject_GetAssetOwner(t *testing.T) {
fields fields
want common.Name
}{
// TODO: Add test cases.
// TODO: Add test cases.
}
for _, tt := range tests {
ao := &AssetObject{
Expand Down Expand Up @@ -441,7 +441,7 @@ func TestAssetObject_SetAssetOwner(t *testing.T) {
fields fields
args args
}{
// TODO: Add test cases.
// TODO: Add test cases.
}
for _, tt := range tests {
ao := &AssetObject{
Expand Down
Loading

0 comments on commit 349efc8

Please sign in to comment.