-
Notifications
You must be signed in to change notification settings - Fork 68
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
94a9fae
commit bf7ecc0
Showing
5 changed files
with
145 additions
and
11 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package hedera | ||
|
||
import ( | ||
"context" | ||
"errors" | ||
|
||
"github.com/hashgraph/hedera-sdk-go/hedera_proto" | ||
) | ||
|
||
type TransactionKind int | ||
|
||
const ( | ||
CryptoCreateAccount TransactionKind = iota | ||
CryptoTransfer | ||
) | ||
|
||
func (tk TransactionKind) execute(client Client, tx hedera_proto.Transaction) (*hedera_proto.TransactionResponse, error) { | ||
switch tk { | ||
case CryptoCreateAccount: | ||
return hedera_proto.NewCryptoServiceClient(client.conn).CreateAccount(context.TODO(), &tx) | ||
case CryptoTransfer: | ||
return nil, errors.New("not implemented yet") | ||
default: | ||
return nil, errors.New("invalid kind provided") | ||
} | ||
} |
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