Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 13 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,24 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-go@v5
with:
go-version-file: go.mod
- name: golangci-lint
- name: golangci-lint (pull request)
if: github.event_name == 'pull_request'
uses: golangci/golangci-lint-action@v6
with:
version: v1.64.8
install-mode: goinstall
args: --new-from-rev=${{ github.event.pull_request.base.sha }}
- name: golangci-lint (push)
if: github.event_name != 'pull_request'
uses: golangci/golangci-lint-action@v6
with:
version: v1.64.5
# Only report issues introduced in the PR.
only-new-issues: true
version: v1.64.8
install-mode: goinstall

security:
name: Security Scans
Expand Down
3 changes: 2 additions & 1 deletion examples/hcs15-build-account-tx/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@ package main
import (
"fmt"

hedera "github.com/hiero-ledger/hiero-sdk-go/v2/sdk"

"github.com/hashgraph-online/standards-sdk-go/pkg/hcs15"
hedera "github.com/hashgraph/hedera-sdk-go/v2"
)

func main() {
Expand Down
3 changes: 2 additions & 1 deletion examples/registry-broker-skill-domain-proof/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,9 @@ import (
"strings"
"time"

hedera "github.com/hiero-ledger/hiero-sdk-go/v2/sdk"

"github.com/hashgraph-online/standards-sdk-go/pkg/registrybroker"
hedera "github.com/hashgraph/hedera-sdk-go/v2"
)

const (
Expand Down
3 changes: 2 additions & 1 deletion examples/registry-broker-uaid-dns-verification/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,9 @@ import (
"strconv"
"strings"

hedera "github.com/hiero-ledger/hiero-sdk-go/v2/sdk"

"github.com/hashgraph-online/standards-sdk-go/pkg/registrybroker"
hedera "github.com/hashgraph/hedera-sdk-go/v2"
)

const defaultBaseURL = "https://hol.org/registry/api/v1"
Expand Down
40 changes: 15 additions & 25 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,43 +1,33 @@
module github.com/hashgraph-online/standards-sdk-go

go 1.24.0
go 1.25.7

require (
github.com/andybalholm/brotli v1.1.1
github.com/btcsuite/btcd/btcec/v2 v2.3.4
github.com/hashgraph/hedera-sdk-go/v2 v2.49.0
github.com/btcsuite/btcd/btcec/v2 v2.3.6
github.com/hiero-ledger/hiero-sdk-go/v2 v2.77.1
github.com/zhouhui8915/go-socket.io-client v0.0.0-20200925034401-83ee73793ba4
google.golang.org/grpc v1.79.3
google.golang.org/protobuf v1.36.11
)

require (
github.com/ProjectZKM/Ziren/crates/go-runtime/zkvm_runtime v0.0.0-20251001021608-1fe7b43fc4d6 // indirect
github.com/bits-and-blooms/bitset v1.20.0 // indirect
github.com/cenkalti/backoff/v4 v4.3.0 // indirect
github.com/consensys/gnark-crypto v0.18.1 // indirect
github.com/crate-crypto/go-eth-kzg v1.4.0 // indirect
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.3.0 // indirect
github.com/ethereum/c-kzg-4844/v2 v2.1.5 // indirect
github.com/ethereum/go-ethereum v1.17.0 // indirect
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.4.1 // indirect
github.com/gorilla/websocket v1.4.2 // indirect
github.com/holiman/uint256 v1.3.2 // indirect
github.com/json-iterator/go v1.1.12 // indirect
github.com/mattn/go-colorable v0.1.13 // indirect
github.com/mattn/go-colorable v0.1.14 // indirect
github.com/mattn/go-isatty v0.0.20 // indirect
github.com/mitchellh/mapstructure v1.5.0 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/rs/zerolog v1.33.0 // indirect
github.com/rs/zerolog v1.35.0 // indirect
github.com/smartystreets/goconvey v1.8.1 // indirect
github.com/supranational/blst v0.3.16-0.20250831170142-f48500c1fdbe // indirect
github.com/tyler-smith/go-bip39 v1.1.0 // indirect
github.com/youmark/pkcs8 v0.0.0-20201027041543-1326539a0a0a // indirect
github.com/youmark/pkcs8 v0.0.0-20240726163527-a2c0da244d78 // indirect
github.com/zhouhui8915/engine.io-go v0.0.0-20150910083302-02ea08f0971f // indirect
golang.org/x/crypto v0.45.0 // indirect
golang.org/x/net v0.47.0 // indirect
golang.org/x/sync v0.18.0 // indirect
golang.org/x/sys v0.39.0 // indirect
golang.org/x/text v0.31.0 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20251222181119-0a764e51fe1b // indirect
google.golang.org/grpc v1.77.0 // indirect
google.golang.org/protobuf v1.36.11 // indirect
golang.org/x/crypto v0.49.0 // indirect
golang.org/x/net v0.52.0 // indirect
golang.org/x/sys v0.42.0 // indirect
golang.org/x/text v0.35.0 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20260316180232-0b37fe3546d5 // indirect
)
128 changes: 32 additions & 96 deletions go.sum

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion pkg/hcs10/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,10 @@ import (
"fmt"
"strings"

hedera "github.com/hiero-ledger/hiero-sdk-go/v2/sdk"

"github.com/hashgraph-online/standards-sdk-go/pkg/mirror"
"github.com/hashgraph-online/standards-sdk-go/pkg/shared"
hedera "github.com/hashgraph/hedera-sdk-go/v2"
)

type Client struct {
Expand Down
82 changes: 57 additions & 25 deletions pkg/hcs10/coverage_test.go
Original file line number Diff line number Diff line change
@@ -1,73 +1,105 @@
package hcs10

import (
"context"
"testing"
"context"
"testing"

"github.com/hashgraph/hedera-sdk-go/v2"
hedera "github.com/hiero-ledger/hiero-sdk-go/v2/sdk"
)

func TestCovNewClientFailures(t *testing.T) {
_, err := NewClient(ClientConfig{Network: "invalid"})
if err == nil { t.Fatal("expected err") }
if err == nil {
t.Fatal("expected err")
}

pk, _ := hedera.PrivateKeyGenerateEcdsa()
client, err := NewClient(ClientConfig{
Network: "testnet",
OperatorAccountID: "0.0.1",
OperatorPrivateKey: pk.String(),
Network: "testnet",
OperatorAccountID: "0.0.1",
OperatorPrivateKey: pk.String(),
})
if err != nil { t.Fatalf("unexpected: %v", err) }
if client.MirrorClient() == nil { t.Fatal("expected mirror") }
if err != nil {
t.Fatalf("unexpected: %v", err)
}
if client.MirrorClient() == nil {
t.Fatal("expected mirror")
}
}

func TestCovOperationsFailure(t *testing.T) {
pk, _ := hedera.PrivateKeyGenerateEcdsa()
client, _ := NewClient(ClientConfig{
Network: "testnet",
OperatorAccountID: "0.0.1",
OperatorPrivateKey: pk.String(),
Network: "testnet",
OperatorAccountID: "0.0.1",
OperatorPrivateKey: pk.String(),
})
ctx := context.Background()

_, _, err := client.CreateInboundTopic(ctx, CreateTopicOptions{})
if err == nil { t.Fatal("expected fail") }
if err == nil {
t.Fatal("expected fail")
}

_, _, err = client.CreateOutboundTopic(ctx, CreateTopicOptions{})
if err == nil { t.Fatal("expected fail") }
if err == nil {
t.Fatal("expected fail")
}

_, _, err = client.CreateConnectionTopic(ctx, CreateTopicOptions{InboundTopicID: "0.0.1"})
if err == nil { t.Fatal("expected fail") }
if err == nil {
t.Fatal("expected fail")
}

_, err2 := client.CreateRegistryTopic(ctx, CreateTopicOptions{})
if err2 == nil { t.Fatal("expected fail") }
if err2 == nil {
t.Fatal("expected fail")
}

_, err2 = client.SendConnectionRequest(ctx, "invalid", "0.0.1", "")
if err2 == nil { t.Fatal("expected fail") }
if err2 == nil {
t.Fatal("expected fail")
}

_, err2 = client.ConfirmConnection(ctx, "invalid", "0.0.2", "0.0.3", "0.0.1", 1, "")
if err2 == nil { t.Fatal("expected fail") }
if err2 == nil {
t.Fatal("expected fail")
}

_, err2 = client.SendMessage(ctx, "invalid", "0.0.1", "hello", "")
if err2 == nil { t.Fatal("expected fail") }
if err2 == nil {
t.Fatal("expected fail")
}

_, err2 = client.RegisterAgent(ctx, "invalid", "0.0.1", "0.0.2", "")
if err2 == nil { t.Fatal("expected fail") }
if err2 == nil {
t.Fatal("expected fail")
}

_, err2 = client.DeleteAgent(ctx, "invalid", "uid1", "")
if err2 == nil { t.Fatal("expected fail") }
if err2 == nil {
t.Fatal("expected fail")
}

_, err = client.GetTopicInfo(ctx, "invalid")
if err == nil { t.Fatal("expected fail") }
if err == nil {
t.Fatal("expected fail")
}
}

func TestCovBuildMemos(t *testing.T) {
m1 := BuildInboundMemo(86400, "0.0.1")
if m1 == "" { t.Fatal("expected memo") }
if m1 == "" {
t.Fatal("expected memo")
}

m2 := BuildOutboundMemo(86400)
if m2 == "" { t.Fatal("expected memo") }
if m2 == "" {
t.Fatal("expected memo")
}

m3 := BuildConnectionMemo(86400, "0.0.1", 1)
if m3 == "" { t.Fatal("expected memo") }
if m3 == "" {
t.Fatal("expected memo")
}
}
2 changes: 1 addition & 1 deletion pkg/hcs10/tx.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"fmt"
"strings"

hedera "github.com/hashgraph/hedera-sdk-go/v2"
hedera "github.com/hiero-ledger/hiero-sdk-go/v2/sdk"
)

// BuildCreateTopicTx builds and returns the configured value.
Expand Down
2 changes: 1 addition & 1 deletion pkg/hcs10/types.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package hcs10

import hedera "github.com/hashgraph/hedera-sdk-go/v2"
import hedera "github.com/hiero-ledger/hiero-sdk-go/v2/sdk"

type TopicType int

Expand Down
3 changes: 2 additions & 1 deletion pkg/hcs11/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,11 @@ import (
"fmt"
"strings"

hedera "github.com/hiero-ledger/hiero-sdk-go/v2/sdk"

"github.com/hashgraph-online/standards-sdk-go/pkg/hcs14"
"github.com/hashgraph-online/standards-sdk-go/pkg/mirror"
"github.com/hashgraph-online/standards-sdk-go/pkg/shared"
hedera "github.com/hashgraph/hedera-sdk-go/v2"
)

type Client struct {
Expand Down
Loading
Loading