Skip to content

Commit

Permalink
Merge branch 'release/v1.6.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
onetechnical committed Apr 21, 2021
2 parents d2744e8 + e9e2313 commit 23e6f18
Show file tree
Hide file tree
Showing 129 changed files with 5,342 additions and 4,667 deletions.
8 changes: 8 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
# ignore cucumber test resources
test-harness/
test/features/
test/features/resources/**/*.json
test/features/resources/**/*.base64
test/features/resources/programs/**/*.tok

# Other misc files
*.log
*.log.archive
*.out
Expand Down
8 changes: 5 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
dist: bionic
language: go

go:
- "1.12"
- "1.13"
- "1.14"

install:
- go get -u golang.org/x/lint/golint

script:
- if [ -n "$DOCKER_PASSWORD" ]; then echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin ; fi
- make docker-test
env:
global:
- secure: i+v/N8vdYLmnSIIq946S1yOiVFiOGKLHuuLJUzQPI61xuLximIz4q8Q38QBane78UoMTRGIbG4jfxYalljRqpQ7b0FuuPPPvI4YHB05nTMqxLk+PR+HFmyEZmWIpae0jWeA3ro1rABAbIb3v7zOYw7scslYGDgmspK4ZvdJEfS4KO2VHk+KCjM4QwJuSz++UF7KdHF7rHkH3ikw6zVHo5uAZhkaEpYA3HUpDnM1OryXQW74+8iXyCrhlL2gDYgphwiPQyucRCVEsVszx+67IIT4Ct+7DM68DwcUCpcaOnHx6bKjge2YFjuGKURja9B9bi30zPFW+l9ALFxASBTkjgUwFOAPbyTDA5Z4K/e389vbDpCVxVwOdT0lQc4sr8L9r8zzEhNQACKQTl5zqrwrJFHguO+rSWNWT0rEWQnCroz5HPpa0siTun8VlHNFvj9dtWS2fIKTCI341lO9BVRjPvIEhfHmP/LdezWvKKhRYAp5UiE5Cj2Ld0PcfMBfQbvVzSKOgEpOxJC2qIhmgFVGW9CRPLtZQDMht9aKNRlmPNxO5kD1vTyHxxUF6XByH17Db6lBNQvoiC7qByBlxFQ3mZD0GVITG3MS8/FpNxnGdmmIIZ9gYR45omAmwwhu0SeBy/oadX9pTh+2E734ks/T+mkJXXuoKO/RG945VZ3u5p1I=
- secure: sQSc+09VHpc3Fy4y3GjawonwWKUuSI5UbBROgdDWFrViAaTxP2JU0Shz1AZKHNwEkyMkq8DemxXctmF60jxk01gNqelPnVFodXqx46zWmpe2+2gkVpsEEQkDKHkj54mHkkYUuc2hWoSqICow/K2hhp3RL1FNPk9gLYmQxQgtJ67PBMJFJuhb/iSBPi3RknuMmDo+r4ifiCH/gG8YsD9SMbc4aBb2WGK07D7mouZjaF9KaHnctVi0s5PcUOXsN4eRyLDB6zPwy3xugEae2ZZUWny6udxqhQFWg1YeU8NqfbDD5XCbBo5xkmxxmk+/sFNqQ1pJuNyioXDfMk5z4Nl1m76+OCUXDI/OeZ2z2HviurV6pbPLAyigrOUylZz67OqtMnGUQPJ4c0Qn0SVlZCdBfaUXQN9PYOpefOAeF3LoJr3ebhnVOSekzpv4fcLFfXeeRnHu0YWP8YzgCOIK6Yyp+uhZbUjghTrU2uFYQe/Mtdue43c+ybSiQZXdu/8xt0UPgXqM2q5aHXU6hOSQyD14LHMGOE50GLb0A5JzKQpv6LjbMEO9vaAbGnOmIzFoFjQREcbHOEourbJe0l0vpJcfanxnnzVzGSvzoAtGaEAASSMuIfhDjhHiXTs7axJwxWszQsNekFB2edtZ+bBk62hbMXSUgBEHMXzGWQbXgu8KVVc=
21 changes: 14 additions & 7 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,16 @@
# 1.6.0
# Added
- Code generation for more of the http client
- Add TEAL 3 support
- template UX tweaks
# Bugfix
- Make limitorder.GetSwapAssetsTransaction behave the same as other SDKs
# 1.5.1
# Added
- Add `BlockRaw` method to algod API V2 client.
# 1.5.0
# Added
- Support for Applications
- Support for Applications
# 1.4.2
# Bugfix
- Fix incorrect `SendRawTransaction` path in API V2 client.
Expand All @@ -21,15 +28,15 @@
- support for Periodic Payment contract
- support for SuggestedParams
- support for RawBlock request
- Missing transaction types
- Missing transaction types
# 1.2.1
# Added
- Added asset decimals field.
# 1.2.0
# Added
- Added support for Algorand Standardized Assets (ASA)
- Added support for Algorand Smart Contracts (ASC)
- Added support for Hashed Time Lock Contract (HTLC)
- Added support for Algorand Smart Contracts (ASC)
- Added support for Hashed Time Lock Contract (HTLC)
- Added support for Split contract
- Added support for Group Transactions
- Added support for leases
Expand All @@ -41,9 +48,9 @@
# Changed
- Add note parameter to key registration transaction constructors
# 1.1.2
# Added
# Added
- Support for GenesisHash
- Updated API Models.
- Updated API Models.
# 1.1.1
## Added
- Indexer support
Expand All @@ -52,7 +59,7 @@
- Multisignature support
# 1.0.6
## Added
- Support in new SuggestedFee functionality
- Support in new SuggestedFee functionality
# 1.0.5
## Added
- Added helper functions for preventing overflow
Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ build: generate

unit:
go test $(TEST_SOURCES_NO_CUCUMBER)
cd test && go test --godog.strict=true --godog.format=pretty --godog.tags="@unit.offline,@unit.algod,@unit.indexer,@unit.rekey,@unit.tealsign,@unit.dryrun,@unit.responses,@unit.applications" --test.v .
cd test && go test --godog.strict=true --godog.format=pretty --godog.tags="@unit.offline,@unit.algod,@unit.indexer,@unit.rekey,@unit.tealsign,@unit.dryrun,@unit.responses,@unit.applications,@unit.transactions,@unit.indexer.rekey,@unit.responses.messagepack,@unit.responses.231,@unit.responses.messagepack.231" --test.v .

integration:
go test $(TEST_SOURCES_NO_CUCUMBER)
cd test && go test --godog.strict=true --godog.format=pretty --godog.tags="@algod,@assets,@auction,@kmd,@send,@template,@indexer,@rekey,@dryrun,@compile,@applications.verified,@indexer.applications" --test.v .
cd test && go test --godog.strict=true --godog.format=pretty --godog.tags="@algod,@assets,@auction,@kmd,@send,@template,@indexer,@rekey,@dryrun,@compile,@applications.verified,@indexer.applications,@indexer.231" --test.v .

docker-test:
./test/docker/run_docker.sh
22 changes: 18 additions & 4 deletions client/v2/algod/accountInformation.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,30 @@ package algod
import (
"context"
"fmt"

"github.com/algorand/go-algorand-sdk/client/v2/common"
"github.com/algorand/go-algorand-sdk/client/v2/common/models"
)

// AccountInformationParams contains all of the query parameters for url serialization.
type AccountInformationParams struct {

// Format configures whether the response object is JSON or MessagePack encoded.
Format string `url:"format,omitempty"`
}

// AccountInformation given a specific account public key, this call returns the
// accounts status, balance and spendable amounts
type AccountInformation struct {
c *Client
account string
c *Client

address string

p AccountInformationParams
}

func (s *AccountInformation) Do(ctx context.Context, headers ...*common.Header) (result models.Account, err error) {
err = s.c.get(ctx, &result, fmt.Sprintf("/v2/accounts/%s", s.account), nil, headers)
// Do performs the HTTP request
func (s *AccountInformation) Do(ctx context.Context, headers ...*common.Header) (response models.Account, err error) {
err = s.c.get(ctx, &response, fmt.Sprintf("/v2/accounts/%v", s.address), s.p, headers)
return
}
73 changes: 49 additions & 24 deletions client/v2/algod/algod.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@ import (
"context"

"github.com/algorand/go-algorand-sdk/client/v2/common"
"github.com/algorand/go-algorand-sdk/client/v2/common/models"
)

const algodAuthHeader = "X-Algo-API-Token"
const authHeader = "X-Algo-API-Token"

type Client common.Client

Expand Down Expand Up @@ -34,59 +35,83 @@ func (c *Client) post(ctx context.Context, response interface{}, path string, bo

// MakeClient is the factory for constructing a ClientV2 for a given endpoint.
func MakeClient(address string, apiToken string) (c *Client, err error) {
commonClient, err := common.MakeClient(address, algodAuthHeader, apiToken)
commonClient, err := common.MakeClient(address, authHeader, apiToken)
c = (*Client)(commonClient)
return
}

func (c *Client) AccountInformation(account string) *AccountInformation {
return &AccountInformation{c: c, account: account}
func (c *Client) HealthCheck() *HealthCheck {
return &HealthCheck{c: c}
}

func (c *Client) Block(round uint64) *Block {
return &Block{c: c, round: round}
func (c *Client) GetGenesis() *GetGenesis {
return &GetGenesis{c: c}
}

func (c *Client) BlockRaw(round uint64) *BlockRaw {
return &BlockRaw{c: c, round: round}
func (c *Client) Versions() *Versions {
return &Versions{c: c}
}

func (c *Client) HealthCheck() *HealthCheck {
return &HealthCheck{c: c}
func (c *Client) AccountInformation(address string) *AccountInformation {
return &AccountInformation{c: c, address: address}
}

func (c *Client) PendingTransactionInformation(txid string) *PendingTransactionInformation {
return &PendingTransactionInformation{c: c, txid: txid}
func (c *Client) PendingTransactionsByAddress(address string) *PendingTransactionsByAddress {
return &PendingTransactionsByAddress{c: c, address: address}
}

func (c *Client) PendingTransactionsByAddress(address string) *PendingTransactionInformationByAddress {
return &PendingTransactionInformationByAddress{c: c, address: address}
func (c *Client) Block(round uint64) *Block {
return &Block{c: c, round: round}
}

func (c *Client) PendingTransactions() *PendingTransactions {
return &PendingTransactions{c: c}
func (c *Client) GetProof(round uint64, txid string) *GetProof {
return &GetProof{c: c, round: round, txid: txid}
}

func (c *Client) SendRawTransaction(tx []byte) *SendRawTransaction {
return &SendRawTransaction{c: c, stx: tx}
func (c *Client) Supply() *Supply {
return &Supply{c: c}
}

func (c *Client) Status() *Status {
return &Status{c: c}
}

func (c *Client) StatusAfterBlock(round uint64) *StatusAfterBlock {
return &StatusAfterBlock{c: c, round: round}
}

func (c *Client) Status() *Status {
return &Status{c: c}
func (c *Client) SendRawTransaction(rawtxn []byte) *SendRawTransaction {
return &SendRawTransaction{c: c, rawtxn: rawtxn}
}

func (c *Client) SuggestedParams() *SuggestedParams {
return &SuggestedParams{c: c}
}

func (c *Client) Supply() *Supply {
return &Supply{c: c}
func (c *Client) PendingTransactions() *PendingTransactions {
return &PendingTransactions{c: c}
}

func (c *Client) Versions() *Versions {
return &Versions{c: c}
func (c *Client) PendingTransactionInformation(txid string) *PendingTransactionInformation {
return &PendingTransactionInformation{c: c, txid: txid}
}

func (c *Client) GetApplicationByID(applicationId uint64) *GetApplicationByID {
return &GetApplicationByID{c: c, applicationId: applicationId}
}

func (c *Client) GetAssetByID(assetId uint64) *GetAssetByID {
return &GetAssetByID{c: c, assetId: assetId}
}

func (c *Client) TealCompile(source []byte) *TealCompile {
return &TealCompile{c: c, source: source}
}

func (c *Client) TealDryrun(request models.DryrunRequest) *TealDryrun {
return &TealDryrun{c: c, request: request}
}

func (c *Client) BlockRaw(round uint64) *BlockRaw {
return &BlockRaw{c: c, round: round}
}
34 changes: 0 additions & 34 deletions client/v2/algod/application_client.go

This file was deleted.

9 changes: 7 additions & 2 deletions client/v2/algod/blockRaw.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,19 @@ import (
"fmt"

"github.com/algorand/go-algorand-sdk/client/v2/common"
"github.com/algorand/go-algorand-sdk/client/v2/common/models"
)

// GetBlockParams defines parameters for GetBlock.
type GetBlockParams struct {
// Return raw msgpack block bytes or json
Format string `url:"format,omitempty"`
}

// BlockRaw contains metadata required to execute a BlockRaw query.
type BlockRaw struct {
c *Client
round uint64
p models.GetBlockParams
p GetBlockParams
}

// Do executes the BlockRaw query and gets the results.
Expand Down
17 changes: 8 additions & 9 deletions client/v2/algod/getApplicationByID.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,17 @@ import (
"github.com/algorand/go-algorand-sdk/client/v2/common/models"
)

// GetApplicationByID /v2/applications/{application-id}
// Given a application id, it returns application information including creator,
// approval and clear programs, global and local schemas, and global state.
// GetApplicationByID given a application id, it returns application information
// including creator, approval and clear programs, global and local schemas, and
// global state.
type GetApplicationByID struct {
c *Client
c *Client

applicationId uint64
}

// Do performs HTTP request
func (s *GetApplicationByID) Do(ctx context.Context,
headers ...*common.Header) (response models.Application, err error) {
err = s.c.get(ctx, &response,
fmt.Sprintf("/v2/applications/%d", s.applicationId), nil, headers)
// Do performs the HTTP request
func (s *GetApplicationByID) Do(ctx context.Context, headers ...*common.Header) (response models.Application, err error) {
err = s.c.get(ctx, &response, fmt.Sprintf("/v2/applications/%v", s.applicationId), nil, headers)
return
}
16 changes: 7 additions & 9 deletions client/v2/algod/getAssetByID.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,16 @@ import (
"github.com/algorand/go-algorand-sdk/client/v2/common/models"
)

// GetAssetByID /v2/assets/{asset-id}
// Given a asset id, it returns asset information including creator, name, total
// supply and special addresses.
// GetAssetByID given a asset id, it returns asset information including creator,
// name, total supply and special addresses.
type GetAssetByID struct {
c *Client
c *Client

assetId uint64
}

// Do performs HTTP request
func (s *GetAssetByID) Do(ctx context.Context,
headers ...*common.Header) (response models.Asset, err error) {
err = s.c.get(ctx, &response,
fmt.Sprintf("/v2/assets/%d", s.assetId), nil, headers)
// Do performs the HTTP request
func (s *GetAssetByID) Do(ctx context.Context, headers ...*common.Header) (response models.Asset, err error) {
err = s.c.get(ctx, &response, fmt.Sprintf("/v2/assets/%v", s.assetId), nil, headers)
return
}
Loading

0 comments on commit 23e6f18

Please sign in to comment.