Skip to content

Commit

Permalink
Add missing iotago.ErrTxCapabilities* mapping to apimodels.TxFailureC…
Browse files Browse the repository at this point in the history
…apabilities*
  • Loading branch information
alexsporn committed Oct 26, 2023
1 parent b707ff1 commit 770a0d4
Show file tree
Hide file tree
Showing 7 changed files with 31 additions and 23 deletions.
10 changes: 5 additions & 5 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -23,18 +23,20 @@ require (
github.com/iotaledger/hive.go/runtime v0.0.0-20231020115340-13da292c580b
github.com/iotaledger/hive.go/serializer/v2 v2.0.0-rc.1.0.20231020115340-13da292c580b
github.com/iotaledger/hive.go/stringify v0.0.0-20231020115340-13da292c580b
github.com/iotaledger/inx-app v1.0.0-rc.3.0.20231023191159-38919c4705e0
github.com/iotaledger/inx/go v1.0.0-rc.2.0.20231023190837-6e7b2cdfd4fd
github.com/iotaledger/iota.go/v4 v4.0.0-20231025071930-7cc5b35d50b1
github.com/iotaledger/inx-app v1.0.0-rc.3.0.20231026154618-820b8eaed2cc
github.com/iotaledger/inx/go v1.0.0-rc.2.0.20231026154523-9ee0c47a283a
github.com/iotaledger/iota.go/v4 v4.0.0-20231026154111-efd63ff4f03d
github.com/labstack/echo/v4 v4.11.2
github.com/labstack/gommon v0.4.0
github.com/libp2p/go-libp2p v0.31.0
github.com/libp2p/go-libp2p-kad-dht v0.25.1
github.com/mr-tron/base58 v1.2.0
github.com/multiformats/go-multiaddr v0.12.0
github.com/multiformats/go-varint v0.0.7
github.com/orcaman/writerseeker v0.0.0-20200621085525-1d3f536ff85e
github.com/otiai10/copy v1.14.0
github.com/prometheus/client_golang v1.17.0
github.com/spf13/pflag v1.0.5
github.com/stretchr/testify v1.8.4
github.com/wollac/iota-crypto-demo v0.0.0-20221117162917-b10619eccb98
github.com/zyedidia/generic v1.2.1
Expand Down Expand Up @@ -126,7 +128,6 @@ require (
github.com/mitchellh/copystructure v1.2.0 // indirect
github.com/mitchellh/mapstructure v1.5.0 // indirect
github.com/mitchellh/reflectwalk v1.0.2 // indirect
github.com/mr-tron/base58 v1.2.0 // indirect
github.com/multiformats/go-base32 v0.1.0 // indirect
github.com/multiformats/go-base36 v0.2.0 // indirect
github.com/multiformats/go-multiaddr-dns v0.3.1 // indirect
Expand Down Expand Up @@ -157,7 +158,6 @@ require (
github.com/sasha-s/go-deadlock v0.3.1 // indirect
github.com/spaolacci/murmur3 v1.1.0 // indirect
github.com/spf13/cast v1.5.1 // indirect
github.com/spf13/pflag v1.0.5 // indirect
github.com/tcnksm/go-latest v0.0.0-20170313132115-e3007ae9052e // indirect
github.com/valyala/bytebufferpool v1.0.0 // indirect
github.com/valyala/fasttemplate v1.2.2 // indirect
Expand Down
12 changes: 6 additions & 6 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -305,12 +305,12 @@ github.com/iotaledger/hive.go/serializer/v2 v2.0.0-rc.1.0.20231020115340-13da292
github.com/iotaledger/hive.go/serializer/v2 v2.0.0-rc.1.0.20231020115340-13da292c580b/go.mod h1:SdK26z8/VhWtxaqCuQrufm80SELgowQPmu9T/8eUQ8g=
github.com/iotaledger/hive.go/stringify v0.0.0-20231020115340-13da292c580b h1:MDZhTZTVDiydXcW5j4TA7HixVCyAdToIMPhHfJee7cE=
github.com/iotaledger/hive.go/stringify v0.0.0-20231020115340-13da292c580b/go.mod h1:FTo/UWzNYgnQ082GI9QVM9HFDERqf9rw9RivNpqrnTs=
github.com/iotaledger/inx-app v1.0.0-rc.3.0.20231023191159-38919c4705e0 h1:/8pbFXhTSroJvjJMfJqfHjzoT9N8B4LUY3SbKruD5MM=
github.com/iotaledger/inx-app v1.0.0-rc.3.0.20231023191159-38919c4705e0/go.mod h1:My1SB4vZj42EgTDNJ/dgW8lUpLNmvtzu8f89J5y2kP0=
github.com/iotaledger/inx/go v1.0.0-rc.2.0.20231023190837-6e7b2cdfd4fd h1:hh5mAnnaZHOYAi4CIqR9K/mv786ex9AQgpisbJ4ZMow=
github.com/iotaledger/inx/go v1.0.0-rc.2.0.20231023190837-6e7b2cdfd4fd/go.mod h1:MK0SHfNicBmcaZb3qS3tA8NEJIWKNbcNtNNKuSDKqXY=
github.com/iotaledger/iota.go/v4 v4.0.0-20231025071930-7cc5b35d50b1 h1:7ChiFHg4KsdS4mKjYpFUUNe9t9nsQzNtJ/XnUV2w5ZM=
github.com/iotaledger/iota.go/v4 v4.0.0-20231025071930-7cc5b35d50b1/go.mod h1:jqbLYq4a/FwuiPBqFfkAwwxU8vs3+kReRq2/tyX5qRA=
github.com/iotaledger/inx-app v1.0.0-rc.3.0.20231026154618-820b8eaed2cc h1:Foz7Q1vNh0Ts+YTEODHO3LSKVGM/uNV3RqbBJS6u7yA=
github.com/iotaledger/inx-app v1.0.0-rc.3.0.20231026154618-820b8eaed2cc/go.mod h1:gaQbe/L+wjjUeQj5N8+o/XdZnSosFmDQfxmfyrK05hc=
github.com/iotaledger/inx/go v1.0.0-rc.2.0.20231026154523-9ee0c47a283a h1:8JbC44pNud1rT091fJA4bDC+35MozksapuCXf8M1kmg=
github.com/iotaledger/inx/go v1.0.0-rc.2.0.20231026154523-9ee0c47a283a/go.mod h1:iXG/tO+GQZQzgIUyITnQDigb6Ny1wSueHFIYne4HBkc=
github.com/iotaledger/iota.go/v4 v4.0.0-20231026154111-efd63ff4f03d h1:gcJz0J3xFELIPT7y4xqW+q25oOcK6QMlxNnrfFu8srA=
github.com/iotaledger/iota.go/v4 v4.0.0-20231026154111-efd63ff4f03d/go.mod h1:jqbLYq4a/FwuiPBqFfkAwwxU8vs3+kReRq2/tyX5qRA=
github.com/ipfs/boxo v0.13.1 h1:nQ5oQzcMZR3oL41REJDcTbrvDvuZh3J9ckc9+ILeRQI=
github.com/ipfs/boxo v0.13.1/go.mod h1:btrtHy0lmO1ODMECbbEY1pxNtrLilvKSYLoGQt1yYCk=
github.com/ipfs/go-cid v0.4.1 h1:A/T3qGvxi4kpKWWcPC/PgbvDA2bjVLO7n4UeVwnbs/s=
Expand Down
8 changes: 8 additions & 0 deletions pkg/retainer/retainer/errors.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,14 @@ var txErrorsFailureReasonMap = map[error]apimodels.TransactionFailureReason{
iotago.ErrInputOutputManaMismatch: apimodels.TxFailureManaAmountInvalid,
iotago.ErrManaAmountInvalid: apimodels.TxFailureManaAmountInvalid,
iotago.ErrInputCreationAfterTxCreation: apimodels.TxFailureInputCreationAfterTxCreation,

// tx capabilities errors
iotago.ErrTxCapabilitiesNativeTokenBurningNotAllowed: apimodels.TxFailureCapabilitiesNativeTokenBurningNotAllowed,
iotago.ErrTxCapabilitiesManaBurningNotAllowed: apimodels.TxFailureCapabilitiesManaBurningNotAllowed,
iotago.ErrTxCapabilitiesAccountDestructionNotAllowed: apimodels.TxFailureCapabilitiesAccountDestructionNotAllowed,
iotago.ErrTxCapabilitiesAnchorDestructionNotAllowed: apimodels.TxFailureCapabilitiesAnchorDestructionNotAllowed,
iotago.ErrTxCapabilitiesFoundryDestructionNotAllowed: apimodels.TxFailureCapabilitiesFoundryDestructionNotAllowed,
iotago.ErrTxCapabilitiesNFTDestructionNotAllowed: apimodels.TxFailureCapabilitiesNFTDestructionNotAllowed,
}

func determineTxFailureReason(err error) apimodels.TransactionFailureReason {
Expand Down
6 changes: 3 additions & 3 deletions tools/gendoc/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,9 @@ require (
github.com/iotaledger/hive.go/runtime v0.0.0-20231020115340-13da292c580b // indirect
github.com/iotaledger/hive.go/serializer/v2 v2.0.0-rc.1.0.20231020115340-13da292c580b // indirect
github.com/iotaledger/hive.go/stringify v0.0.0-20231020115340-13da292c580b // indirect
github.com/iotaledger/inx-app v1.0.0-rc.3.0.20231023191159-38919c4705e0 // indirect
github.com/iotaledger/inx/go v1.0.0-rc.2.0.20231023190837-6e7b2cdfd4fd // indirect
github.com/iotaledger/iota.go/v4 v4.0.0-20231025071930-7cc5b35d50b1 // indirect
github.com/iotaledger/inx-app v1.0.0-rc.3.0.20231026154618-820b8eaed2cc // indirect
github.com/iotaledger/inx/go v1.0.0-rc.2.0.20231026154523-9ee0c47a283a // indirect
github.com/iotaledger/iota.go/v4 v4.0.0-20231026154111-efd63ff4f03d // indirect
github.com/ipfs/boxo v0.13.1 // indirect
github.com/ipfs/go-cid v0.4.1 // indirect
github.com/ipfs/go-datastore v0.6.0 // indirect
Expand Down
12 changes: 6 additions & 6 deletions tools/gendoc/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -309,12 +309,12 @@ github.com/iotaledger/hive.go/serializer/v2 v2.0.0-rc.1.0.20231020115340-13da292
github.com/iotaledger/hive.go/serializer/v2 v2.0.0-rc.1.0.20231020115340-13da292c580b/go.mod h1:SdK26z8/VhWtxaqCuQrufm80SELgowQPmu9T/8eUQ8g=
github.com/iotaledger/hive.go/stringify v0.0.0-20231020115340-13da292c580b h1:MDZhTZTVDiydXcW5j4TA7HixVCyAdToIMPhHfJee7cE=
github.com/iotaledger/hive.go/stringify v0.0.0-20231020115340-13da292c580b/go.mod h1:FTo/UWzNYgnQ082GI9QVM9HFDERqf9rw9RivNpqrnTs=
github.com/iotaledger/inx-app v1.0.0-rc.3.0.20231023191159-38919c4705e0 h1:/8pbFXhTSroJvjJMfJqfHjzoT9N8B4LUY3SbKruD5MM=
github.com/iotaledger/inx-app v1.0.0-rc.3.0.20231023191159-38919c4705e0/go.mod h1:My1SB4vZj42EgTDNJ/dgW8lUpLNmvtzu8f89J5y2kP0=
github.com/iotaledger/inx/go v1.0.0-rc.2.0.20231023190837-6e7b2cdfd4fd h1:hh5mAnnaZHOYAi4CIqR9K/mv786ex9AQgpisbJ4ZMow=
github.com/iotaledger/inx/go v1.0.0-rc.2.0.20231023190837-6e7b2cdfd4fd/go.mod h1:MK0SHfNicBmcaZb3qS3tA8NEJIWKNbcNtNNKuSDKqXY=
github.com/iotaledger/iota.go/v4 v4.0.0-20231025071930-7cc5b35d50b1 h1:7ChiFHg4KsdS4mKjYpFUUNe9t9nsQzNtJ/XnUV2w5ZM=
github.com/iotaledger/iota.go/v4 v4.0.0-20231025071930-7cc5b35d50b1/go.mod h1:jqbLYq4a/FwuiPBqFfkAwwxU8vs3+kReRq2/tyX5qRA=
github.com/iotaledger/inx-app v1.0.0-rc.3.0.20231026154618-820b8eaed2cc h1:Foz7Q1vNh0Ts+YTEODHO3LSKVGM/uNV3RqbBJS6u7yA=
github.com/iotaledger/inx-app v1.0.0-rc.3.0.20231026154618-820b8eaed2cc/go.mod h1:gaQbe/L+wjjUeQj5N8+o/XdZnSosFmDQfxmfyrK05hc=
github.com/iotaledger/inx/go v1.0.0-rc.2.0.20231026154523-9ee0c47a283a h1:8JbC44pNud1rT091fJA4bDC+35MozksapuCXf8M1kmg=
github.com/iotaledger/inx/go v1.0.0-rc.2.0.20231026154523-9ee0c47a283a/go.mod h1:iXG/tO+GQZQzgIUyITnQDigb6Ny1wSueHFIYne4HBkc=
github.com/iotaledger/iota.go/v4 v4.0.0-20231026154111-efd63ff4f03d h1:gcJz0J3xFELIPT7y4xqW+q25oOcK6QMlxNnrfFu8srA=
github.com/iotaledger/iota.go/v4 v4.0.0-20231026154111-efd63ff4f03d/go.mod h1:jqbLYq4a/FwuiPBqFfkAwwxU8vs3+kReRq2/tyX5qRA=
github.com/ipfs/boxo v0.13.1 h1:nQ5oQzcMZR3oL41REJDcTbrvDvuZh3J9ckc9+ILeRQI=
github.com/ipfs/boxo v0.13.1/go.mod h1:btrtHy0lmO1ODMECbbEY1pxNtrLilvKSYLoGQt1yYCk=
github.com/ipfs/go-cid v0.4.1 h1:A/T3qGvxi4kpKWWcPC/PgbvDA2bjVLO7n4UeVwnbs/s=
Expand Down
2 changes: 1 addition & 1 deletion tools/genesis-snapshot/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ require (
github.com/iotaledger/hive.go/lo v0.0.0-20231020115340-13da292c580b
github.com/iotaledger/hive.go/runtime v0.0.0-20231020115340-13da292c580b
github.com/iotaledger/iota-core v0.0.0-00010101000000-000000000000
github.com/iotaledger/iota.go/v4 v4.0.0-20231025071930-7cc5b35d50b1
github.com/iotaledger/iota.go/v4 v4.0.0-20231026154111-efd63ff4f03d
github.com/mr-tron/base58 v1.2.0
github.com/spf13/pflag v1.0.5
golang.org/x/crypto v0.14.0
Expand Down
4 changes: 2 additions & 2 deletions tools/genesis-snapshot/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ github.com/iotaledger/hive.go/serializer/v2 v2.0.0-rc.1.0.20231020115340-13da292
github.com/iotaledger/hive.go/serializer/v2 v2.0.0-rc.1.0.20231020115340-13da292c580b/go.mod h1:SdK26z8/VhWtxaqCuQrufm80SELgowQPmu9T/8eUQ8g=
github.com/iotaledger/hive.go/stringify v0.0.0-20231020115340-13da292c580b h1:MDZhTZTVDiydXcW5j4TA7HixVCyAdToIMPhHfJee7cE=
github.com/iotaledger/hive.go/stringify v0.0.0-20231020115340-13da292c580b/go.mod h1:FTo/UWzNYgnQ082GI9QVM9HFDERqf9rw9RivNpqrnTs=
github.com/iotaledger/iota.go/v4 v4.0.0-20231025071930-7cc5b35d50b1 h1:7ChiFHg4KsdS4mKjYpFUUNe9t9nsQzNtJ/XnUV2w5ZM=
github.com/iotaledger/iota.go/v4 v4.0.0-20231025071930-7cc5b35d50b1/go.mod h1:jqbLYq4a/FwuiPBqFfkAwwxU8vs3+kReRq2/tyX5qRA=
github.com/iotaledger/iota.go/v4 v4.0.0-20231026154111-efd63ff4f03d h1:gcJz0J3xFELIPT7y4xqW+q25oOcK6QMlxNnrfFu8srA=
github.com/iotaledger/iota.go/v4 v4.0.0-20231026154111-efd63ff4f03d/go.mod h1:jqbLYq4a/FwuiPBqFfkAwwxU8vs3+kReRq2/tyX5qRA=
github.com/ipfs/go-cid v0.4.1 h1:A/T3qGvxi4kpKWWcPC/PgbvDA2bjVLO7n4UeVwnbs/s=
github.com/ipfs/go-cid v0.4.1/go.mod h1:uQHwDeX4c6CtyrFwdqyhpNcxVewur1M7l7fNU7LKwZk=
github.com/klauspost/cpuid/v2 v2.2.5 h1:0E5MSMDEoAulmXNFquVs//DdoomxaoTY1kUhbc/qbZg=
Expand Down

0 comments on commit 770a0d4

Please sign in to comment.