-
Notifications
You must be signed in to change notification settings - Fork 98
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
Showing
40 changed files
with
541 additions
and
102 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
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 |
---|---|---|
|
@@ -6,23 +6,23 @@ jobs: | |
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check out code into the Go module directory | ||
uses: actions/checkout@v3.5.3 | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 # required for new-from-rev option in .golangci.yml | ||
- name: Install specific golang | ||
uses: actions/setup-go@v4.0.1 | ||
uses: actions/setup-go@v5 | ||
with: | ||
go-version: '1.21.10' | ||
go-version: '1.23.3' | ||
- name: Check format | ||
run: test -z `go fmt ./...` | ||
- name: Vet | ||
run: go vet ./... | ||
- name: reviewdog-golangci-lint | ||
uses: reviewdog/[email protected].1 | ||
uses: reviewdog/[email protected].2 | ||
with: | ||
golangci_lint_version: "v1.58.0" | ||
golangci_lint_version: "v1.62.0" | ||
golangci_lint_flags: "-c .golangci.yml --allow-parallel-runners" | ||
go_version: "1.21.10" | ||
go_version: "1.23.3" | ||
reporter: "github-pr-review" | ||
tool_name: "Lint Errors" | ||
level: "error" | ||
|
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 was deleted.
Oops, something went wrong.
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,32 @@ | ||
package algod | ||
|
||
import ( | ||
"context" | ||
"fmt" | ||
|
||
"github.com/algorand/go-algorand-sdk/v2/client/v2/common" | ||
"github.com/algorand/go-algorand-sdk/v2/client/v2/common/models" | ||
) | ||
|
||
// GetBlockHeaderParams contains all of the query parameters for url serialization. | ||
type GetBlockHeaderParams struct { | ||
|
||
// Format configures whether the response object is JSON or MessagePack encoded. If | ||
// not provided, defaults to JSON. | ||
Format string `url:"format,omitempty"` | ||
} | ||
|
||
// GetBlockHeader get the block header for the block on the given round. | ||
type GetBlockHeader struct { | ||
c *Client | ||
|
||
round uint64 | ||
|
||
p GetBlockHeaderParams | ||
} | ||
|
||
// Do performs the HTTP request | ||
func (s *GetBlockHeader) Do(ctx context.Context, headers ...*common.Header) (response models.BlockHeaderResponse, err error) { | ||
err = s.c.get(ctx, &response, fmt.Sprintf("/v2/blocks/%s/header", common.EscapeParams(s.round)...), s.p, headers) | ||
return | ||
} |
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,9 @@ | ||
package models | ||
|
||
import "github.com/algorand/go-algorand-sdk/v2/types" | ||
|
||
// BlockHeaderResponse block header. | ||
type BlockHeaderResponse struct { | ||
// Blockheader block header data. | ||
Blockheader types.Block `json:"blockHeader"` | ||
} |
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,14 @@ | ||
package models | ||
|
||
// BlockHeadersResponse | ||
type BlockHeadersResponse struct { | ||
// Blocks | ||
Blocks []Block `json:"blocks"` | ||
|
||
// CurrentRound round at which the results were computed. | ||
CurrentRound uint64 `json:"current-round"` | ||
|
||
// NextToken used for pagination, when making another request provide this token | ||
// with the next parameter. | ||
NextToken string `json:"next-token,omitempty"` | ||
} |
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,22 @@ | ||
package models | ||
|
||
// HbProofFields (hbprf) HbProof is a signature using HeartbeatAddress's partkey, | ||
// thereby showing it is online. | ||
type HbProofFields struct { | ||
// HbPk (p) Public key of the heartbeat message. | ||
HbPk []byte `json:"hb-pk,omitempty"` | ||
|
||
// HbPk1sig (p1s) Signature of OneTimeSignatureSubkeyOffsetID(PK, Batch, Offset) | ||
// under the key PK2. | ||
HbPk1sig []byte `json:"hb-pk1sig,omitempty"` | ||
|
||
// HbPk2 (p2) Key for new-style two-level ephemeral signature. | ||
HbPk2 []byte `json:"hb-pk2,omitempty"` | ||
|
||
// HbPk2sig (p2s) Signature of OneTimeSignatureSubkeyBatchID(PK2, Batch) under the | ||
// master key (OneTimeSignatureVerifier). | ||
HbPk2sig []byte `json:"hb-pk2sig,omitempty"` | ||
|
||
// HbSig (s) Signature of the heartbeat message. | ||
HbSig []byte `json:"hb-sig,omitempty"` | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package models | ||
|
||
// TransactionHeartbeat fields for a heartbeat transaction. | ||
// Definition: | ||
// data/transactions/heartbeat.go : HeartbeatTxnFields | ||
type TransactionHeartbeat struct { | ||
// HbAddress (hbad) HbAddress is the account this txn is proving onlineness for. | ||
HbAddress string `json:"hb-address"` | ||
|
||
// HbKeyDilution (hbkd) HbKeyDilution must match HbAddress account's current | ||
// KeyDilution. | ||
HbKeyDilution uint64 `json:"hb-key-dilution"` | ||
|
||
// HbProof (hbprf) HbProof is a signature using HeartbeatAddress's partkey, thereby | ||
// showing it is online. | ||
HbProof HbProofFields `json:"hb-proof"` | ||
|
||
// HbSeed (hbsd) HbSeed must be the block seed for the this transaction's | ||
// firstValid block. | ||
HbSeed []byte `json:"hb-seed"` | ||
|
||
// HbVoteId (hbvid) HbVoteID must match the HbAddress account's current VoteID. | ||
HbVoteId []byte `json:"hb-vote-id"` | ||
} |
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
Oops, something went wrong.