Skip to content

Commit

Permalink
Update iota.go
Browse files Browse the repository at this point in the history
  • Loading branch information
muXxer committed Nov 23, 2023
1 parent ccd5b84 commit f6ea945
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 21 deletions.
2 changes: 1 addition & 1 deletion examples/go/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ replace github.com/iotaledger/inx/go => ../../go

require (
github.com/iotaledger/inx/go v0.0.0-00010101000000-000000000000
github.com/iotaledger/iota.go/v4 v4.0.0-20231117155557-c2903737fac0
github.com/iotaledger/iota.go/v4 v4.0.0-20231123102955-eff367396512
google.golang.org/grpc v1.59.0
)

Expand Down
4 changes: 2 additions & 2 deletions examples/go/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ github.com/iotaledger/hive.go/serializer/v2 v2.0.0-rc.1.0.20231113110812-4ca2b6c
github.com/iotaledger/hive.go/serializer/v2 v2.0.0-rc.1.0.20231113110812-4ca2b6cc9a42/go.mod h1:FoH3T6yKlZJp8xm8K+zsQiibSynp32v21CpWx8xkek8=
github.com/iotaledger/hive.go/stringify v0.0.0-20231113110812-4ca2b6cc9a42 h1:9c7NiX2cnNPHR9UNWINDqNkolupXiDF3543pR6KLwIg=
github.com/iotaledger/hive.go/stringify v0.0.0-20231113110812-4ca2b6cc9a42/go.mod h1:FTo/UWzNYgnQ082GI9QVM9HFDERqf9rw9RivNpqrnTs=
github.com/iotaledger/iota.go/v4 v4.0.0-20231117155557-c2903737fac0 h1:l5ZxRsKvYiGZWCfDZmZr6NoCG1zndHwDpTM7Fwesbsg=
github.com/iotaledger/iota.go/v4 v4.0.0-20231117155557-c2903737fac0/go.mod h1:1CUJKGvkOUGXakxFZGAagEQDX9qYyhzIElmUHCHo9RM=
github.com/iotaledger/iota.go/v4 v4.0.0-20231123102955-eff367396512 h1:E1m9Ja6d47sVkl0k2a8eU9f5COWqpyNY9ET3TyYLHiI=
github.com/iotaledger/iota.go/v4 v4.0.0-20231123102955-eff367396512/go.mod h1:aO+5iL0vTNwNfE4QMGHVIufGziSI1wTvwJY1ipSMgCk=
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
github.com/mr-tron/base58 v1.2.0 h1:T/HDJBh4ZCPbU39/+c3rRvE0uKBQlU27+QI8LJ4t64o=
Expand Down
2 changes: 1 addition & 1 deletion go/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ require (
github.com/iotaledger/hive.go/ierrors v0.0.0-20231113110812-4ca2b6cc9a42
github.com/iotaledger/hive.go/lo v0.0.0-20231113110812-4ca2b6cc9a42
github.com/iotaledger/hive.go/serializer/v2 v2.0.0-rc.1.0.20231113110812-4ca2b6cc9a42
github.com/iotaledger/iota.go/v4 v4.0.0-20231120063545-80c263f28140
github.com/iotaledger/iota.go/v4 v4.0.0-20231123102955-eff367396512
google.golang.org/grpc v1.59.0
google.golang.org/protobuf v1.31.0
)
Expand Down
4 changes: 2 additions & 2 deletions go/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ github.com/iotaledger/hive.go/serializer/v2 v2.0.0-rc.1.0.20231113110812-4ca2b6c
github.com/iotaledger/hive.go/serializer/v2 v2.0.0-rc.1.0.20231113110812-4ca2b6cc9a42/go.mod h1:FoH3T6yKlZJp8xm8K+zsQiibSynp32v21CpWx8xkek8=
github.com/iotaledger/hive.go/stringify v0.0.0-20231113110812-4ca2b6cc9a42 h1:9c7NiX2cnNPHR9UNWINDqNkolupXiDF3543pR6KLwIg=
github.com/iotaledger/hive.go/stringify v0.0.0-20231113110812-4ca2b6cc9a42/go.mod h1:FTo/UWzNYgnQ082GI9QVM9HFDERqf9rw9RivNpqrnTs=
github.com/iotaledger/iota.go/v4 v4.0.0-20231120063545-80c263f28140 h1:8zHRYT1KADR9bOLUg7Ia4XA3StBHzV4Tb2Qtp42KLN8=
github.com/iotaledger/iota.go/v4 v4.0.0-20231120063545-80c263f28140/go.mod h1:1CUJKGvkOUGXakxFZGAagEQDX9qYyhzIElmUHCHo9RM=
github.com/iotaledger/iota.go/v4 v4.0.0-20231123102955-eff367396512 h1:E1m9Ja6d47sVkl0k2a8eU9f5COWqpyNY9ET3TyYLHiI=
github.com/iotaledger/iota.go/v4 v4.0.0-20231123102955-eff367396512/go.mod h1:aO+5iL0vTNwNfE4QMGHVIufGziSI1wTvwJY1ipSMgCk=
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
github.com/mr-tron/base58 v1.2.0 h1:T/HDJBh4ZCPbU39/+c3rRvE0uKBQlU27+QI8LJ4t64o=
Expand Down
29 changes: 14 additions & 15 deletions go/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import (
"github.com/iotaledger/hive.go/serializer/v2/serix"
iotago "github.com/iotaledger/iota.go/v4"
"github.com/iotaledger/iota.go/v4/api"
"github.com/iotaledger/iota.go/v4/nodeclient/apimodels"
)

func blockIDsFromSlice(slice []*BlockId) iotago.BlockIDs {
Expand Down Expand Up @@ -240,9 +239,9 @@ func (x *RawProtocolParameters) Unwrap() (iotago.EpochIndex, iotago.ProtocolPara
return iotago.EpochIndex(x.StartEpoch), params, nil
}

func (x *NodeConfiguration) APIProvider() *api.EpochBasedProvider {
func (x *NodeConfiguration) APIProvider() *iotago.EpochBasedProvider {
// Create a new api provider that uses the protocol parameters of the node
apiProvider := api.NewEpochBasedProvider()
apiProvider := iotago.NewEpochBasedProvider()

for _, rawParams := range x.GetProtocolParameters() {
startEpoch, protoParams, err := rawParams.Unwrap()
Expand All @@ -258,36 +257,36 @@ func (x *NodeConfiguration) APIProvider() *api.EpochBasedProvider {

// BlockMetadata

func WrapBlockState(state apimodels.BlockState) BlockMetadata_BlockState {
func WrapBlockState(state api.BlockState) BlockMetadata_BlockState {
return BlockMetadata_BlockState(state)
}

func WrapBlockFailureReason(reason apimodels.BlockFailureReason) BlockMetadata_BlockFailureReason {
func WrapBlockFailureReason(reason api.BlockFailureReason) BlockMetadata_BlockFailureReason {
return BlockMetadata_BlockFailureReason(reason)
}

func WrapTransactionState(state apimodels.TransactionState) BlockMetadata_TransactionState {
func WrapTransactionState(state api.TransactionState) BlockMetadata_TransactionState {
return BlockMetadata_TransactionState(state)
}

func WrapTransactionFailureReason(reason apimodels.TransactionFailureReason) BlockMetadata_TransactionFailureReason {
func WrapTransactionFailureReason(reason api.TransactionFailureReason) BlockMetadata_TransactionFailureReason {
return BlockMetadata_TransactionFailureReason(reason)
}

func (x BlockMetadata_BlockState) Unwrap() apimodels.BlockState {
return apimodels.BlockState(x)
func (x BlockMetadata_BlockState) Unwrap() api.BlockState {
return api.BlockState(x)
}

func (x BlockMetadata_TransactionState) Unwrap() apimodels.TransactionState {
return apimodels.TransactionState(x)
func (x BlockMetadata_TransactionState) Unwrap() api.TransactionState {
return api.TransactionState(x)
}

func (x BlockMetadata_BlockFailureReason) Unwrap() apimodels.BlockFailureReason {
return apimodels.BlockFailureReason(x)
func (x BlockMetadata_BlockFailureReason) Unwrap() api.BlockFailureReason {
return api.BlockFailureReason(x)
}

func (x BlockMetadata_TransactionFailureReason) Unwrap() apimodels.TransactionFailureReason {
return apimodels.TransactionFailureReason(x)
func (x BlockMetadata_TransactionFailureReason) Unwrap() api.TransactionFailureReason {
return api.TransactionFailureReason(x)
}

// Block Issuance
Expand Down

0 comments on commit f6ea945

Please sign in to comment.