Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
B
burrow
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Hang Yu
burrow
Commits
9182a76c
Unverified
Commit
9182a76c
authored
8 years ago
by
Benjamin Bollen
Browse files
Options
Downloads
Patches
Plain Diff
client: clean up dead-code in transaction-factory
parent
2eed4148
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
client/core/transaction_factory.go
+18
-117
18 additions, 117 deletions
client/core/transaction_factory.go
with
18 additions
and
117 deletions
client/core/transaction_factory.go
+
18
−
117
View file @
9182a76c
...
...
@@ -238,24 +238,24 @@ func Unbond(addrS, heightS string) (*txs.UnbondTx, error) {
func
Rebond
(
addrS
,
heightS
string
)
(
*
txs
.
RebondTx
,
error
)
{
return
nil
,
fmt
.
Errorf
(
"Rebond Transaction formation to be implemented on 0.12.0"
)
// if addrS == "" {
// return nil, fmt.Errorf("Validator address must be given with --addr flag")
// }
// addrBytes, err := hex.DecodeString(addrS)
// if err != nil {
// return nil, fmt.Errorf("addr is bad hex: %v", err)
// }
// height, err := strconv.ParseInt(heightS, 10, 32)
// if err != nil {
// return nil, fmt.Errorf("height is misformatted: %v", err)
// }
// return &types.RebondTx{
// Address: addrBytes,
// Height: int(height),
// }, nil
// if addrS == "" {
// return nil, fmt.Errorf("Validator address must be given with --addr flag")
// }
// addrBytes, err := hex.DecodeString(addrS)
// if err != nil {
// return nil, fmt.Errorf("addr is bad hex: %v", err)
// }
// height, err := strconv.ParseInt(heightS, 10, 32)
// if err != nil {
// return nil, fmt.Errorf("height is misformatted: %v", err)
// }
// return &types.RebondTx{
// Address: addrBytes,
// Height: int(height),
// }, nil
}
type
TxResult
struct
{
...
...
@@ -344,102 +344,3 @@ func SignAndBroadcast(chainID string, nodeClient client.NodeClient, keyClient ke
}
return
}
//------------------------------------------------------------------------------------
// wait for events
// type Msg struct {
// BlockHash []byte
// Value []byte
// Exception string
// Error error
// }
// func subscribeAndWait(tx txs.Tx, chainID string, nodeAddr string, inputAddr []byte) (chan Msg, error) {
// // subscribe to event and wait for tx to be committed
// var wsAddr string
// if strings.HasPrefix(nodeAddr, "http://") {
// wsAddr = strings.TrimPrefix(nodeAddr, "http://")
// }
// if strings.HasPrefix(nodeAddr, "tcp://") {
// wsAddr = strings.TrimPrefix(nodeAddr, "tcp://")
// }
// if strings.HasPrefix(nodeAddr, "unix://") {
// log.WithFields(log.Fields{
// "node address": nodeAddr,
// }).Warn("Unable to subscribe to websocket from unix socket.")
// return nil, fmt.Errorf("Unable to subscribe to websocket from unix socket: %s", nodeAddr)
// }
// wsAddr = "ws://" + wsAddr
// log.WithFields(log.Fields{
// "websocket address": wsAddr,
// "endpoint": "/websocket",
// }).Debug("Subscribing to websocket address")
// wsClient := rpcclient.NewWSClient(wsAddr, "/websocket")
// wsClient.Start()
// eid := txs.EventStringAccInput(inputAddr)
// if err := wsClient.Subscribe(eid); err != nil {
// return nil, fmt.Errorf("Error subscribing to AccInput event: %v", err)
// }
// if err := wsClient.Subscribe(txs.EventStringNewBlock()); err != nil {
// return nil, fmt.Errorf("Error subscribing to NewBlock event: %v", err)
// }
// resultChan := make(chan Msg, 1)
// var latestBlockHash []byte
// // Read message
// go func() {
// for {
// result := <-wsClient.EventsCh
// // if its a block, remember the block hash
// blockData, ok := result.Data.(txs.EventDataNewBlock)
// if ok {
// log.Infoln(blockData.Block)
// latestBlockHash = blockData.Block.Hash()
// continue
// }
// // we don't accept events unless they came after a new block (ie. in)
// if latestBlockHash == nil {
// continue
// }
// if result.Event != eid {
// logger.Debugf("received unsolicited event! Got %s, expected %s\n", result.Event, eid)
// continue
// }
// data, ok := result.Data.(types.EventDataTx)
// if !ok {
// resultChan <- Msg{Error: fmt.Errorf("response error: expected result.Data to be *types.EventDataTx")}
// return
// }
// if !bytes.Equal(types.TxID(chainID, data.Tx), types.TxID(chainID, tx)) {
// logger.Debugf("Received event for same input from another transaction: %X\n", types.TxID(chainID, data.Tx))
// continue
// }
// if data.Exception != "" {
// resultChan <- Msg{BlockHash: latestBlockHash, Value: data.Return, Exception: data.Exception}
// return
// }
// // GOOD!
// resultChan <- Msg{BlockHash: latestBlockHash, Value: data.Return}
// return
// }
// }()
// // txs should take no more than 10 seconds
// timeoutTicker := time.Tick(time.Duration(MaxCommitWaitTimeSeconds) * time.Second)
// go func() {
// <-timeoutTicker
// resultChan <- Msg{Error: fmt.Errorf("timed out waiting for event")}
// return
// }()
// return resultChan, nil
// }
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment