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
22ed4668
Unverified
Commit
22ed4668
authored
8 years ago
by
Benjamin Bollen
Browse files
Options
Downloads
Patches
Plain Diff
client: transaction factory expose Bond, Unbond, Rebond signature
parent
480ab113
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
+54
-51
54 additions, 51 deletions
client/core/transaction_factory.go
with
54 additions
and
51 deletions
client/core/transaction_factory.go
+
54
−
51
View file @
22ed4668
...
@@ -184,58 +184,61 @@ func Permissions(nodeClient client.NodeClient, keyClient keys.KeyClient, pubkey,
...
@@ -184,58 +184,61 @@ func Permissions(nodeClient client.NodeClient, keyClient keys.KeyClient, pubkey,
return
tx
,
nil
return
tx
,
nil
}
}
// func Bond(nodeAddr, signAddr, pubkey, unbondAddr, amtS, nonceS string) (*txs.BondTx, error) {
func
Bond
(
nodeClient
client
.
NodeClient
,
keyClient
keys
.
KeyClient
,
pubkey
,
unbondAddr
,
amtS
,
nonceS
string
)
(
*
txs
.
BondTx
,
error
)
{
// pub, amt, nonce, err := checkCommon(nodeAddr, signAddr, pubkey, "", amtS, nonceS)
return
nil
,
fmt
.
Errorf
(
"Bond Transaction formation to be implemented on 0.12.0"
)
// if err != nil {
// pub, amt, nonce, err := checkCommon(nodeAddr, signAddr, pubkey, "", amtS, nonceS)
// return nil, err
// if err != nil {
// }
// return nil, err
// var pubKey crypto.PubKeyEd25519
// }
// var unbondAddrBytes []byte
// var pubKey crypto.PubKeyEd25519
// var unbondAddrBytes []byte
// if unbondAddr == "" {
// pkb, _ := hex.DecodeString(pubkey)
// if unbondAddr == "" {
// copy(pubKey[:], pkb)
// pkb, _ := hex.DecodeString(pubkey)
// unbondAddrBytes = pubKey.Address()
// copy(pubKey[:], pkb)
// } else {
// unbondAddrBytes = pubKey.Address()
// unbondAddrBytes, err = hex.DecodeString(unbondAddr)
// } else {
// if err != nil {
// unbondAddrBytes, err = hex.DecodeString(unbondAddr)
// return nil, fmt.Errorf("unbondAddr is bad hex: %v", err)
// if err != nil {
// }
// return nil, fmt.Errorf("unbondAddr is bad hex: %v", err)
// }
// }
// }
// tx, err := types.NewBondTx(pub)
// if err != nil {
// tx, err := types.NewBondTx(pub)
// return nil, err
// if err != nil {
// }
// return nil, err
// tx.AddInputWithNonce(pub, amt, int(nonce))
// }
// tx.AddOutput(unbondAddrBytes, amt)
// tx.AddInputWithNonce(pub, amt, int(nonce))
// tx.AddOutput(unbondAddrBytes, amt)
// return tx, nil
// }
// return tx, nil
}
// func Unbond(addrS, heightS string) (*txs.UnbondTx, error) {
// 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.UnbondTx{
func
Unbond
(
addrS
,
heightS
string
)
(
*
txs
.
UnbondTx
,
error
)
{
// Address: addrBytes,
return
nil
,
fmt
.
Errorf
(
"Unbond Transaction formation to be implemented on 0.12.0"
)
// Height: int(height),
// if addrS == "" {
// }, nil
// 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.UnbondTx{
// Address: addrBytes,
// Height: int(height),
// }, nil
}
// func Rebond(addrS, heightS string) (*txs.RebondTx, 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 == "" {
// if addrS == "" {
// return nil, fmt.Errorf("Validator address must be given with --addr flag")
// return nil, fmt.Errorf("Validator address must be given with --addr flag")
// }
// }
...
@@ -254,7 +257,7 @@ func Permissions(nodeClient client.NodeClient, keyClient keys.KeyClient, pubkey,
...
@@ -254,7 +257,7 @@ func Permissions(nodeClient client.NodeClient, keyClient keys.KeyClient, pubkey,
// Address: addrBytes,
// Address: addrBytes,
// Height: int(height),
// Height: int(height),
// }, nil
// }, nil
//
}
}
type
TxResult
struct
{
type
TxResult
struct
{
BlockHash
[]
byte
// all txs get in a block
BlockHash
[]
byte
// all txs get in a block
...
...
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