forked from IBAX-io/go-ibax
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix bugs, default interface, fix PrepareColumns, delete errors, fix h…
…istory function
- Loading branch information
Showing
15 changed files
with
175 additions
and
79 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
language: go | ||
go_import_path: github.com/IBAX/go-ibax | ||
|
||
install: true | ||
env: GO111MODULE=on | ||
|
||
script: go build github.com/IBAX/go-ibax | ||
go: | ||
- 1.12.x |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
/*--------------------------------------------------------------------------------------------- | ||
* Copyright (c) IBAX. All rights reserved. | ||
* See LICENSE in the project root for license information. | ||
*--------------------------------------------------------------------------------------------*/ | ||
|
||
package cmd | ||
|
||
import ( | ||
"github.com/IBAX-io/go-ibax/packages/conf" | ||
"github.com/IBAX-io/go-ibax/packages/conf/syspar" | ||
"github.com/IBAX-io/go-ibax/packages/model" | ||
"github.com/IBAX-io/go-ibax/packages/rollback" | ||
"github.com/IBAX-io/go-ibax/packages/smart" | ||
"github.com/IBAX-io/go-ibax/packages/utils" | ||
|
||
log "github.com/sirupsen/logrus" | ||
"github.com/spf13/cobra" | ||
) | ||
|
||
var blockID int64 | ||
|
||
// rollbackCmd represents the rollback command | ||
return | ||
} | ||
if err := syspar.SysUpdate(nil); err != nil { | ||
log.WithError(err).Error("can't read system parameters") | ||
} | ||
if err := syspar.SysTableColType(nil); err != nil { | ||
log.WithFields(log.Fields{"error": err}).Error("updating sys table col type") | ||
} | ||
|
||
smart.InitVM() | ||
if err := smart.LoadContracts(); err != nil { | ||
log.WithError(err).Fatal("loading contracts") | ||
return | ||
} | ||
err := rollback.ToBlockID(blockID, nil, log.WithFields(log.Fields{})) | ||
if err != nil { | ||
log.WithError(err).Fatal("rollback to block id") | ||
return | ||
} | ||
|
||
// block id = 1, is a special case for full rollback | ||
if blockID != 1 { | ||
log.Info("Not full rollback, finishing work without checking") | ||
return | ||
} | ||
}, | ||
} | ||
|
||
func init() { | ||
rollbackCmd.Flags().Int64Var(&blockID, "blockId", 1, "blockID to rollback") | ||
rollbackCmd.MarkFlagRequired("blockId") | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 18 additions & 0 deletions
18
packages/migration/contracts/first_ecosystem/NewApplication.sim
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
// +prop AppID = '1' | ||
// +prop Conditions = 'ContractConditions("MainCondition")' | ||
contract NewApplication { | ||
data { | ||
|
||
if Size($Name) == 0 { | ||
warning "Application name missing" | ||
} | ||
|
||
if DBFind("applications").Columns("id").Where({name:$Name}).One("id") { | ||
warning Sprintf( "Application %s already exists", $Name) | ||
} | ||
} | ||
|
||
action { | ||
$result = DBInsert("applications", {name: $Name,conditions: $Conditions}) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters