diff --git a/iroha-go/go.mod b/iroha-go/go.mod index 6701d5c..0a3cc38 100644 --- a/iroha-go/go.mod +++ b/iroha-go/go.mod @@ -3,7 +3,7 @@ module github.com/datachainlab/iroha-ibc-modules/iroha-go go 1.16 require ( - github.com/crpt/go-crpt v0.1.4 + github.com/crpt/go-crpt v0.1.3 github.com/davecgh/go-spew v1.1.1 // indirect github.com/golang/protobuf v1.4.3 github.com/stretchr/testify v1.7.0 diff --git a/iroha-go/go.sum b/iroha-go/go.sum index 0979530..88f8d5b 100644 --- a/iroha-go/go.sum +++ b/iroha-go/go.sum @@ -1,34 +1,20 @@ cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= -cloud.google.com/go v0.34.0 h1:eOI3/cP2VTU6uZLDYAoic+eyzzB9YyGmJ7eIjl8rOPg= cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= -filippo.io/edwards25519 v1.0.0-rc.1 h1:m0VOOB23frXZvAOK44usCgLWvtsxIoMCTBGJZlpmGfU= -filippo.io/edwards25519 v1.0.0-rc.1/go.mod h1:N1IkdkCkiLB6tki+MYJoSx2JTY9NUlxZE7eHn5EwJns= -github.com/BurntSushi/toml v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= -github.com/antihax/optional v1.0.0 h1:xK2lYat7ZLaVVcIuj82J8kIro4V6kDe0AUDFboUCwcg= github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= -github.com/census-instrumentation/opencensus-proto v0.2.1 h1:glEXhBS5PSLLv4IXzLA5yPRVX4bilULVyxxbrfOtDAk= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= -github.com/cespare/xxhash/v2 v2.1.1 h1:6MnRN8NT7+YBpUIWxHtefFZOKTAPgGjpQSxqLNn0+qY= github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= -github.com/client9/misspell v0.3.4 h1:ta993UF76GwbvJcIo3Y68y/M3WxlpEHPWIGDkJYwzJI= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= -github.com/cncf/udpa/go v0.0.0-20210930031921-04548b0d99d4 h1:hzAQntlaYRkVSFEfj9OTWlVV1H155FMD8BTKktLv0QI= github.com/cncf/udpa/go v0.0.0-20210930031921-04548b0d99d4/go.mod h1:6pvJx4me5XPnfI9Z40ddWsdw2W/uZgQLFXToKeRcDiI= github.com/cncf/xds/go v0.0.0-20210805033703-aa0b78936158/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cncf/xds/go v0.0.0-20210922020428-25de7278fc84/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= -github.com/cncf/xds/go v0.0.0-20211011173535-cb28da3451f1 h1:zH8ljVhhq7yC0MIeUL/IviMtY8hx2mK8cN9wEYb8ggw= github.com/cncf/xds/go v0.0.0-20211011173535-cb28da3451f1/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= -github.com/crpt/go-crpt v0.1.4 h1:su4MyVXEFmIcnacr5PB8wwnc29Cxf3LddkkUn1A58/w= -github.com/crpt/go-crpt v0.1.4/go.mod h1:Ue/jw4eoVJcWuB6/dcWwiYJ67L7NwdPRMtvFlr6lOZA= -github.com/crpt/go-ed25519-sha3-512 v1.1.2 h1:SlEzmoKtqcM5/w1IsRO6FUbaHRZfjwio7l4RtNW7lsc= -github.com/crpt/go-ed25519-sha3-512 v1.1.2/go.mod h1:zHtGwjnVmcxLU4Lp8VwGuvImY+RJyVBh3z4wlqJcPtY= -github.com/crpt/go-ed25519consensus v0.0.0-20211108162203-2edba5fb514d h1:Mps02xPHtl9M28lM2Uovi++tPoLVxv0vPdUhfVtQLHk= -github.com/crpt/go-ed25519consensus v0.0.0-20211108162203-2edba5fb514d/go.mod h1:LZIYMa0DBxqk27SaMwAHEqvxDyqF95aGCTOad+pBCP8= -github.com/crpt/go-ed25519consensus-sha3-512 v0.0.0-20211108155746-78fa3c0ee791 h1:rM6H7OgmsbGe88emU1DUq3Sd3n4f2inH8ffnI7B23xo= -github.com/crpt/go-ed25519consensus-sha3-512 v0.0.0-20211108155746-78fa3c0ee791/go.mod h1:3BZy+dn87cWgRuatVP3tGenTbOxCbDp3mEc4noDfzjA= +github.com/crpt/go-crpt v0.1.3 h1:WxVqphVntxUsr3lh8XbeB/ZFlhkvneFj2ke+z6LRf5s= +github.com/crpt/go-crpt v0.1.3/go.mod h1:ijTpgRo2xIJ72uamvRspmeGUOmN86r2kJ2iTYmERdN8= +github.com/crpt/go-ed25519-sha3-512 v1.1.0 h1:/45W+yYD/zHf8+M+VcH9tsISLwDVyTElIzMV2SQ5Npg= +github.com/crpt/go-ed25519-sha3-512 v1.1.0/go.mod h1:oUGu0UWNhGpilJFKhxL64hR3rFKNaPCasz+qjCvvnqw= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= @@ -36,15 +22,10 @@ github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymF github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= -github.com/envoyproxy/go-control-plane v0.9.10-0.20210907150352-cf90f659a021 h1:fP+fF0up6oPY49OrjPrhIJ8yQfdIM85NXMLkMg1EXVs= github.com/envoyproxy/go-control-plane v0.9.10-0.20210907150352-cf90f659a021/go.mod h1:AFq3mo9L8Lqqiid3OhADV3RfLJnjiw63cSpi+fDTRC0= -github.com/envoyproxy/protoc-gen-validate v0.1.0 h1:EQciDnbrYxy13PgWoY8AqoxGiPrpgBZ1R8UNe3ddc+A= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= -github.com/ghodss/yaml v1.0.0 h1:wQHKEahhL6wmXdzwWG11gIVCkOv05bNOh+Rxn0yngAk= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= -github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b h1:VKtxabqXZkF25pY9ekfRL6a582T4P37/31XEstQ5p58= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= -github.com/golang/mock v1.1.1 h1:G5FRp8JnTd7RQH5kemVNlMeyXQAztQ3mOWV95KxsXH8= github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= @@ -64,32 +45,24 @@ github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMyw github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.0 h1:/QaMHBdZ26BB3SSst0Iwl10Epc+xhTquomWX0oZEB6w= github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/uuid v1.1.2 h1:EVhdT+1Kseyi1/pUmXKaFxYsDNy9RQYkMWRH68J/W7Y= github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/grpc-ecosystem/grpc-gateway v1.16.0 h1:gmcG1KaJ57LophUzW0Hy8NmPhnMZb4M0+kPpLofRdBo= github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4 h1:gQz4mCbXsO+nc9n1hCxHcGA3Zx3Eo+UHZoInFGUIXNM= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= -github.com/rogpeppe/fastuuid v1.2.0 h1:Ppwyp6VYCF1nvBTXL3trRso7mXMlRrw9ooo375wvi2s= github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= -github.com/stretchr/objx v0.1.0 h1:4G4v2dO3VZwixGIRoQ5Lfboy6nUhCyYzaqnIAPPhYs4= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY= github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -go.opentelemetry.io/proto/otlp v0.7.0 h1:rwOQPCuKAKmwGKq2aVNnYIibI6wnV7EvzgfTCzcdGg8= go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519 h1:7I4JAnoQBe7ZtJcBaYHi5UtiO8tQHbUSXxL+pnGRANg= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -golang.org/x/exp v0.0.0-20190121172915-509febef88a4 h1:c2HOrn5iMezYjSlGPncknSEr/8x5LELb/ilJbXi9DEA= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= -golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3 h1:XQyxROzUlZH+WIQwySDgnISgOivlhjIEwaQaJEJrrN0= golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -101,12 +74,10 @@ golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81R golang.org/x/net v0.0.0-20210226172049-e18ecbb05110 h1:qWPm9rbaAMKs8Bq/9LRpbMqxWRVUAQwMI9fVrssnTfw= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= -golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d h1:TzXSXBo42m9gQenoE3b9BGiEpg5IG2JkU5FkPIawgtw= golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20190423024810-112230192c58 h1:8gQV6CLnAEikrhgkHFbMAEhagSSnXWGV915qUMm9mrU= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -115,7 +86,6 @@ golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1 h1:SrN+KX8Art/Sf4HNj6Zcz06G7VEz+7w9tdXTPOZ7+l4= golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1 h1:v+OssWQX+hTHEmOBgwxdZxK4zHq3yOs8F9J7mk0PY8E= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.3 h1:cokOdA+Jmi5PJGXLlLllQSgYigAEfHXJAERHVMaCc2k= @@ -124,13 +94,11 @@ golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGm golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135 h1:5Beo0mZN8dRzgrMMkDp0jc8YXQKx9DiJ2k1dkvGsn5A= golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= -google.golang.org/appengine v1.4.0 h1:/wp5JvzpHIxhs/dumFmF7BXTf3Z+dd4uXta4kVyO508= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= @@ -143,8 +111,6 @@ google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQ google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= google.golang.org/grpc v1.33.1/go.mod h1:fr5YgcSWrqhRRxogOsw7RzIpsmvOZ6IcH4kBYTpR3n0= google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= -google.golang.org/grpc v1.42.0 h1:XT2/MFpuPFsEX2fWh3YQtHkZ+WYZFQRfaUgLZYj/p6A= -google.golang.org/grpc v1.42.0/go.mod h1:k+4IHHFw41K8+bbowsex27ge2rCb65oeWqe4jJ590SU= google.golang.org/grpc v1.43.0 h1:Eeu7bZtDZ2DpRCsLhUlcrLnvYaMK1Gz86a+hMVvELmM= google.golang.org/grpc v1.43.0/go.mod h1:k+4IHHFw41K8+bbowsex27ge2rCb65oeWqe4jJ590SU= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= @@ -160,11 +126,9 @@ google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlba gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.2.3 h1:fvjTMHxHEw/mxHbtzPi3JCcKXQRAnQTBRo6YCJSVHKI= gopkg.in/yaml.v2 v2.2.3/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b h1:h8qDotaEPuJATrMmW04NCwg7v22aHH28wwpauUhK9Oo= gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc h1:/hemPrYIhOhy8zYrNj+069zDB68us2sMGsfkFJO0iZs= honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= diff --git a/onchain-module/go.sum b/onchain-module/go.sum index 023bdbb..3ec4f2a 100644 --- a/onchain-module/go.sum +++ b/onchain-module/go.sum @@ -1,7 +1,5 @@ cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= -filippo.io/edwards25519 v1.0.0-rc.1 h1:m0VOOB23frXZvAOK44usCgLWvtsxIoMCTBGJZlpmGfU= -filippo.io/edwards25519 v1.0.0-rc.1/go.mod h1:N1IkdkCkiLB6tki+MYJoSx2JTY9NUlxZE7eHn5EwJns= github.com/Azure/azure-pipeline-go v0.2.1/go.mod h1:UGSo8XybXnIGZ3epmeBw7Jdz+HiUVpqIlpz/HKHylF4= github.com/Azure/azure-pipeline-go v0.2.2/go.mod h1:4rQ/NZncSvGqNkkOsNpOU1tgoNuIlp9AfUH5G1tvCHc= github.com/Azure/azure-storage-blob-go v0.7.0/go.mod h1:f9YQKtsG1nMisotuTPpO0tjNuEjKRYAcJU8/ydDI++4= @@ -91,14 +89,10 @@ github.com/coreos/go-systemd v0.0.0-20180511133405-39ca1b05acc7/go.mod h1:F5haX7 github.com/coreos/pkg v0.0.0-20160727233714-3ac0863d7acf/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7DoTY= -github.com/crpt/go-crpt v0.1.4 h1:su4MyVXEFmIcnacr5PB8wwnc29Cxf3LddkkUn1A58/w= -github.com/crpt/go-crpt v0.1.4/go.mod h1:Ue/jw4eoVJcWuB6/dcWwiYJ67L7NwdPRMtvFlr6lOZA= -github.com/crpt/go-ed25519-sha3-512 v1.1.2 h1:SlEzmoKtqcM5/w1IsRO6FUbaHRZfjwio7l4RtNW7lsc= -github.com/crpt/go-ed25519-sha3-512 v1.1.2/go.mod h1:zHtGwjnVmcxLU4Lp8VwGuvImY+RJyVBh3z4wlqJcPtY= -github.com/crpt/go-ed25519consensus v0.0.0-20211108162203-2edba5fb514d h1:Mps02xPHtl9M28lM2Uovi++tPoLVxv0vPdUhfVtQLHk= -github.com/crpt/go-ed25519consensus v0.0.0-20211108162203-2edba5fb514d/go.mod h1:LZIYMa0DBxqk27SaMwAHEqvxDyqF95aGCTOad+pBCP8= -github.com/crpt/go-ed25519consensus-sha3-512 v0.0.0-20211108155746-78fa3c0ee791 h1:rM6H7OgmsbGe88emU1DUq3Sd3n4f2inH8ffnI7B23xo= -github.com/crpt/go-ed25519consensus-sha3-512 v0.0.0-20211108155746-78fa3c0ee791/go.mod h1:3BZy+dn87cWgRuatVP3tGenTbOxCbDp3mEc4noDfzjA= +github.com/crpt/go-crpt v0.1.3 h1:WxVqphVntxUsr3lh8XbeB/ZFlhkvneFj2ke+z6LRf5s= +github.com/crpt/go-crpt v0.1.3/go.mod h1:ijTpgRo2xIJ72uamvRspmeGUOmN86r2kJ2iTYmERdN8= +github.com/crpt/go-ed25519-sha3-512 v1.1.0 h1:/45W+yYD/zHf8+M+VcH9tsISLwDVyTElIzMV2SQ5Npg= +github.com/crpt/go-ed25519-sha3-512 v1.1.0/go.mod h1:oUGu0UWNhGpilJFKhxL64hR3rFKNaPCasz+qjCvvnqw= github.com/datachainlab/solidity-protobuf/protobuf-solidity/src/protoc/go v0.0.0-20211215073805-59460caf6e59 h1:afNTBJlcPUH7gUskGG+y3SADsIxXa4T60mdBWt5J1EA= github.com/datachainlab/solidity-protobuf/protobuf-solidity/src/protoc/go v0.0.0-20211215073805-59460caf6e59/go.mod h1:qEfy4NhH1wQB+j56MqpQGJMDX4DS56hNnF535upHygI= github.com/davecgh/go-spew v0.0.0-20171005155431-ecdeabc65495/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= diff --git a/relayer/chains/iroha/cmd/cmd.go b/relayer/chains/iroha/cmd/cmd.go index 7d83ab8..c37bb83 100644 --- a/relayer/chains/iroha/cmd/cmd.go +++ b/relayer/chains/iroha/cmd/cmd.go @@ -13,6 +13,7 @@ func IrohaCmd(ctx *config.Context) *cobra.Command { cmd.AddCommand( configCmd(ctx), + transactionCmd(ctx), ) return cmd diff --git a/relayer/chains/iroha/cmd/config.go b/relayer/chains/iroha/cmd/config.go index c130f89..b8a8f0c 100644 --- a/relayer/chains/iroha/cmd/config.go +++ b/relayer/chains/iroha/cmd/config.go @@ -28,8 +28,10 @@ func configCmd(ctx *config.Context) *cobra.Command { func setContractAddressCmd(ctx *config.Context) *cobra.Command { const ( - flagIbcHostAddress = "ibc-host" - flagIbcHandlerAddress = "ibc-handler" + flagIbcHostAddress = "ibc-host" + flagIbcHandlerAddress = "ibc-handler" + flagIrohaIcs20BankAddress = "iroha-ics20-bank" + flagIrohaIcs20TransferAddress = "iroha-ics20-transfer" ) cmd := &cobra.Command{ Use: "set-contract [chain-id]", @@ -74,6 +76,18 @@ func setContractAddressCmd(ctx *config.Context) *cobra.Command { cfg.IbcHandlerAddress = v } + if v, err := cmd.Flags().GetString(flagIrohaIcs20BankAddress); err != nil { + return err + } else { + cfg.IrohaIcs20BankAddress = v + } + + if v, err := cmd.Flags().GetString(flagIrohaIcs20TransferAddress); err != nil { + return err + } else { + cfg.IrohaIcs20TransferAddress = v + } + if cbz, err := utils.MarshalJSONAny(ctx.Codec, &cfg); err != nil { return err } else { @@ -102,6 +116,8 @@ func setContractAddressCmd(ctx *config.Context) *cobra.Command { cmd.Flags().String(flagIbcHostAddress, "", "the address of the IBCHost contract") cmd.Flags().String(flagIbcHandlerAddress, "", "the address of the IBCHandler contract") + cmd.Flags().String(flagIrohaIcs20BankAddress, "", "the address of the IrohaICS20Bank contract") + cmd.Flags().String(flagIrohaIcs20TransferAddress, "", "the address of the IrohaICS20TransferBank contract") return cmd } diff --git a/relayer/chains/iroha/cmd/tx.go b/relayer/chains/iroha/cmd/tx.go new file mode 100644 index 0000000..c0ee19c --- /dev/null +++ b/relayer/chains/iroha/cmd/tx.go @@ -0,0 +1,87 @@ +package cmd + +import ( + "context" + "encoding/json" + "fmt" + "time" + + "github.com/datachainlab/iroha-ibc-modules/relayer/chains/iroha" + "github.com/hyperledger-labs/yui-relayer/config" + "github.com/spf13/cobra" +) + +func transactionCmd(ctx *config.Context) *cobra.Command { + cmd := &cobra.Command{ + Use: "tx", + Short: "send eth tx to iroha (gateway)", + } + + cmd.AddCommand( + setBankCmd(ctx), + ) + + return cmd +} + +func setBankCmd(ctx *config.Context) *cobra.Command { + cmd := &cobra.Command{ + Use: "set-bank [chain-id] [bank-account-id]", + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) (err error) { + chainID := args[0] + bankAccountID := args[1] + + // find chain config + var cfg iroha.ChainConfig + { + var found bool + for _, config := range ctx.Config.Chains { + if err := config.Init(ctx.Codec); err != nil { + return err + } else if chain, err := config.Build(); err != nil { + return err + } else if chain.ChainID() == chainID { + if err := json.Unmarshal(config.Chain, &cfg); err != nil { + return err + } + found = true + break + } + } + if !found { + return fmt.Errorf("chain config not found for chain_id:%s", chainID) + } + } + + // create IrohaICS20Bank client + rpcCli, err := iroha.NewRPCClient(cfg.RpcAddr) + if err != nil { + return err + } + bank, err := iroha.NewIrohaIcs20Bank(cfg.IrohaICS20BankAddress(), rpcCli) + if err != nil { + return err + } + + // submit tx of setBank + tx, err := bank.Transact( + transactOpts(cmd.Context(), cfg.AccountId), + "setBank", + bankAccountID, + ) + if err != nil { + return err + } + + // wait for receipt + toCtx, cancel := context.WithTimeout(cmd.Context(), time.Minute) + _, err = waitForReceipt(toCtx, rpcCli, tx.ID) + defer cancel() + + return err + }, + } + + return cmd +} diff --git a/relayer/chains/iroha/cmd/util.go b/relayer/chains/iroha/cmd/util.go new file mode 100644 index 0000000..88bb50b --- /dev/null +++ b/relayer/chains/iroha/cmd/util.go @@ -0,0 +1,53 @@ +package cmd + +import ( + "context" + "time" + + "github.com/ethereum/go-ethereum/accounts/abi/bind" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/core/types" + gethcrypto "github.com/ethereum/go-ethereum/crypto" + "github.com/ethereum/go-ethereum/ethclient" + "github.com/ethereum/go-ethereum/rpc" +) + +func accountIDToAddress(accountID string) common.Address { + hash := gethcrypto.Keccak256([]byte(accountID)) + return common.BytesToAddress(hash[12:32]) +} + +func transactOpts(ctx context.Context, accountID string) *bind.TransactOpts { + return &bind.TransactOpts{ + From: accountIDToAddress(accountID), + Context: ctx, + } +} + +func callOpts(ctx context.Context, accountID string) *bind.CallOpts { + return &bind.CallOpts{ + From: accountIDToAddress(accountID), + Context: ctx, + } +} + +func waitForReceipt(ctx context.Context, rpcCli *rpc.Client, txHash common.Hash) (*types.Receipt, error) { + ethCli := ethclient.NewClient(rpcCli) + + queryTicker := time.NewTicker(time.Second) + defer queryTicker.Stop() + for { + receipt, err := ethCli.TransactionReceipt(ctx, txHash) + if err != nil { + return nil, err + } else if receipt != nil { + return receipt, nil + } else { + select { + case <-ctx.Done(): + return nil, ctx.Err() + case <-queryTicker.C: + } + } + } +} diff --git a/relayer/chains/iroha/config.go b/relayer/chains/iroha/config.go index 859c97b..d3c2c4b 100644 --- a/relayer/chains/iroha/config.go +++ b/relayer/chains/iroha/config.go @@ -18,3 +18,11 @@ func (c ChainConfig) IBCHostAddress() common.Address { func (c ChainConfig) IBCHandlerAddress() common.Address { return common.HexToAddress(c.IbcHandlerAddress) } + +func (c ChainConfig) IrohaICS20BankAddress() common.Address { + return common.HexToAddress(c.IrohaIcs20BankAddress) +} + +func (c ChainConfig) IrohaICS20TransferAddress() common.Address { + return common.HexToAddress(c.IrohaIcs20TransferAddress) +} diff --git a/relayer/chains/iroha/config.pb.go b/relayer/chains/iroha/config.pb.go index da192c4..429c5ca 100644 --- a/relayer/chains/iroha/config.pb.go +++ b/relayer/chains/iroha/config.pb.go @@ -27,9 +27,11 @@ type ChainConfig struct { ChainId string `protobuf:"bytes,1,opt,name=chain_id,json=chainId,proto3" json:"chain_id,omitempty"` RpcAddr string `protobuf:"bytes,2,opt,name=rpc_addr,json=rpcAddr,proto3" json:"rpc_addr,omitempty"` // use for relayer - AccountId string `protobuf:"bytes,3,opt,name=account_id,json=accountId,proto3" json:"account_id,omitempty"` - IbcHostAddress string `protobuf:"bytes,5,opt,name=ibc_host_address,json=ibcHostAddress,proto3" json:"ibc_host_address,omitempty"` - IbcHandlerAddress string `protobuf:"bytes,6,opt,name=ibc_handler_address,json=ibcHandlerAddress,proto3" json:"ibc_handler_address,omitempty"` + AccountId string `protobuf:"bytes,3,opt,name=account_id,json=accountId,proto3" json:"account_id,omitempty"` + IbcHostAddress string `protobuf:"bytes,5,opt,name=ibc_host_address,json=ibcHostAddress,proto3" json:"ibc_host_address,omitempty"` + IbcHandlerAddress string `protobuf:"bytes,6,opt,name=ibc_handler_address,json=ibcHandlerAddress,proto3" json:"ibc_handler_address,omitempty"` + IrohaIcs20BankAddress string `protobuf:"bytes,7,opt,name=iroha_ics20_bank_address,json=irohaIcs20BankAddress,proto3" json:"iroha_ics20_bank_address,omitempty"` + IrohaIcs20TransferAddress string `protobuf:"bytes,8,opt,name=iroha_ics20_transfer_address,json=irohaIcs20TransferAddress,proto3" json:"iroha_ics20_transfer_address,omitempty"` } func (m *ChainConfig) Reset() { *m = ChainConfig{} } @@ -72,25 +74,28 @@ func init() { func init() { proto.RegisterFile("relayer/chains/iroha/config.proto", fileDescriptor_3cd3ec72750e2d68) } var fileDescriptor_3cd3ec72750e2d68 = []byte{ - // 276 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x6c, 0xd0, 0xb1, 0x4e, 0xf3, 0x30, - 0x14, 0x05, 0xe0, 0xf8, 0xff, 0x45, 0xa1, 0x46, 0x42, 0x10, 0x18, 0x02, 0x08, 0x0b, 0x98, 0xba, - 0xd4, 0x1e, 0xe0, 0x05, 0x4a, 0x17, 0xba, 0x76, 0x64, 0x89, 0x1c, 0xdb, 0x24, 0x96, 0x42, 0x1c, - 0x5d, 0x27, 0x43, 0xde, 0x82, 0x07, 0xe2, 0x01, 0x3a, 0x76, 0x64, 0x84, 0xe4, 0x45, 0x50, 0xae, - 0x23, 0x26, 0x36, 0xfb, 0x9e, 0xef, 0x2c, 0x87, 0xde, 0x81, 0x29, 0x65, 0x67, 0x40, 0xa8, 0x42, - 0xda, 0xca, 0x0b, 0x0b, 0xae, 0x90, 0x42, 0xb9, 0xea, 0xd5, 0xe6, 0xbc, 0x06, 0xd7, 0xb8, 0xf8, - 0x7a, 0x22, 0x3c, 0x10, 0x8e, 0x84, 0x07, 0x72, 0x75, 0x91, 0xbb, 0xdc, 0xa1, 0x13, 0xe3, 0x2b, - 0x54, 0xee, 0x3f, 0x08, 0x3d, 0x5e, 0x8f, 0x7a, 0x8d, 0x2a, 0xbe, 0xa4, 0x47, 0x58, 0x4e, 0xad, - 0x4e, 0xc8, 0x2d, 0x59, 0xcc, 0xb7, 0x87, 0xf8, 0xdf, 0xe8, 0x31, 0x82, 0x5a, 0xa5, 0x52, 0x6b, - 0x48, 0xfe, 0x85, 0x08, 0x6a, 0xb5, 0xd2, 0x1a, 0xe2, 0x1b, 0x4a, 0xa5, 0x52, 0xae, 0xad, 0x9a, - 0xb1, 0xf7, 0x1f, 0xc3, 0xf9, 0x74, 0xd9, 0xe8, 0x78, 0x41, 0x4f, 0x6d, 0xa6, 0xd2, 0xc2, 0xf9, - 0x06, 0xeb, 0xc6, 0xfb, 0xe4, 0x00, 0xd1, 0x89, 0xcd, 0xd4, 0xb3, 0xf3, 0xcd, 0x2a, 0x5c, 0x63, - 0x4e, 0xcf, 0x51, 0xca, 0x4a, 0x97, 0x06, 0x7e, 0xf1, 0x0c, 0xf1, 0xd9, 0x88, 0x43, 0x32, 0xf9, - 0xa7, 0xed, 0xee, 0x9b, 0x45, 0xbb, 0x9e, 0x91, 0x7d, 0xcf, 0xc8, 0x57, 0xcf, 0xc8, 0xfb, 0xc0, - 0xa2, 0xfd, 0xc0, 0xa2, 0xcf, 0x81, 0x45, 0x2f, 0x8f, 0xb9, 0x6d, 0x8a, 0x36, 0xe3, 0xca, 0xbd, - 0x89, 0xa2, 0xab, 0x0d, 0x94, 0x46, 0xe7, 0x06, 0x96, 0xa5, 0xcc, 0xbc, 0xe8, 0x5a, 0xbb, 0xfc, - 0x6b, 0xd2, 0x6c, 0x86, 0xcb, 0x3c, 0xfc, 0x04, 0x00, 0x00, 0xff, 0xff, 0x4d, 0xb7, 0x88, 0x2b, - 0x71, 0x01, 0x00, 0x00, + // 328 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x6c, 0x91, 0xbb, 0x4e, 0xc3, 0x30, + 0x14, 0x40, 0x93, 0x22, 0xfa, 0x30, 0x12, 0x82, 0x00, 0x52, 0xca, 0xc3, 0x02, 0xa6, 0x2e, 0x4d, + 0x10, 0x20, 0x31, 0xa2, 0xb6, 0x0b, 0x5d, 0x2b, 0x26, 0x96, 0xc8, 0xb1, 0xdd, 0xc4, 0x6a, 0xb0, + 0x23, 0x3b, 0x1d, 0xfa, 0x17, 0x7c, 0x0d, 0xdf, 0xd0, 0xb1, 0x23, 0x23, 0x34, 0x3f, 0x82, 0x72, + 0x9d, 0x96, 0x0e, 0x6c, 0xc9, 0x3d, 0xe7, 0xd8, 0xb2, 0x2e, 0xba, 0xd1, 0x3c, 0x23, 0x0b, 0xae, + 0x43, 0x9a, 0x12, 0x21, 0x4d, 0x28, 0xb4, 0x4a, 0x49, 0x48, 0x95, 0x9c, 0x8a, 0x24, 0xc8, 0xb5, + 0x2a, 0x94, 0x77, 0x51, 0x2b, 0x81, 0x55, 0x02, 0x50, 0x02, 0xab, 0x9c, 0x9f, 0x26, 0x2a, 0x51, + 0xe0, 0x85, 0xd5, 0x97, 0x4d, 0x6e, 0x3f, 0x1b, 0xe8, 0x60, 0x54, 0xd9, 0x23, 0xb0, 0xbc, 0x2e, + 0x6a, 0x43, 0x1c, 0x09, 0xe6, 0xbb, 0xd7, 0x6e, 0xaf, 0x33, 0x69, 0xc1, 0xff, 0x98, 0x55, 0x48, + 0xe7, 0x34, 0x22, 0x8c, 0x69, 0xbf, 0x61, 0x91, 0xce, 0xe9, 0x80, 0x31, 0xed, 0x5d, 0x21, 0x44, + 0x28, 0x55, 0x73, 0x59, 0x54, 0xdd, 0x1e, 0xc0, 0x4e, 0x3d, 0x19, 0x33, 0xaf, 0x87, 0x8e, 0x44, + 0x4c, 0xa3, 0x54, 0x99, 0x02, 0x72, 0x6e, 0x8c, 0xbf, 0x0f, 0xd2, 0xa1, 0x88, 0xe9, 0x8b, 0x32, + 0xc5, 0xc0, 0x4e, 0xbd, 0x00, 0x9d, 0x80, 0x49, 0x24, 0xcb, 0xb8, 0xde, 0xca, 0x4d, 0x90, 0x8f, + 0x2b, 0xd9, 0x92, 0x8d, 0xff, 0x84, 0x7c, 0x78, 0x64, 0x24, 0xa8, 0xb9, 0xbf, 0x8b, 0x62, 0x22, + 0x67, 0xdb, 0xa8, 0x05, 0xd1, 0x19, 0xf0, 0x71, 0x85, 0x87, 0x44, 0xce, 0x36, 0xe1, 0x33, 0xba, + 0xdc, 0x0d, 0x0b, 0x4d, 0xa4, 0x99, 0xee, 0xdc, 0xd8, 0x86, 0xb8, 0xfb, 0x17, 0xbf, 0xd6, 0x46, + 0x7d, 0xc0, 0x70, 0xb2, 0xfc, 0xc1, 0xce, 0x72, 0x8d, 0xdd, 0xd5, 0x1a, 0xbb, 0xdf, 0x6b, 0xec, + 0x7e, 0x94, 0xd8, 0x59, 0x95, 0xd8, 0xf9, 0x2a, 0xb1, 0xf3, 0xf6, 0x98, 0x88, 0x22, 0x9d, 0xc7, + 0x01, 0x55, 0xef, 0x61, 0xba, 0xc8, 0xb9, 0xce, 0x38, 0x4b, 0xb8, 0xee, 0x67, 0x24, 0x36, 0xe1, + 0x62, 0x2e, 0xfa, 0xff, 0x2d, 0x33, 0x6e, 0xc2, 0x4e, 0x1e, 0x7e, 0x03, 0x00, 0x00, 0xff, 0xff, + 0x1d, 0x5e, 0xeb, 0x64, 0xeb, 0x01, 0x00, 0x00, } func (m *ChainConfig) Marshal() (dAtA []byte, err error) { @@ -113,6 +118,20 @@ func (m *ChainConfig) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if len(m.IrohaIcs20TransferAddress) > 0 { + i -= len(m.IrohaIcs20TransferAddress) + copy(dAtA[i:], m.IrohaIcs20TransferAddress) + i = encodeVarintConfig(dAtA, i, uint64(len(m.IrohaIcs20TransferAddress))) + i-- + dAtA[i] = 0x42 + } + if len(m.IrohaIcs20BankAddress) > 0 { + i -= len(m.IrohaIcs20BankAddress) + copy(dAtA[i:], m.IrohaIcs20BankAddress) + i = encodeVarintConfig(dAtA, i, uint64(len(m.IrohaIcs20BankAddress))) + i-- + dAtA[i] = 0x3a + } if len(m.IbcHandlerAddress) > 0 { i -= len(m.IbcHandlerAddress) copy(dAtA[i:], m.IbcHandlerAddress) @@ -188,6 +207,14 @@ func (m *ChainConfig) Size() (n int) { if l > 0 { n += 1 + l + sovConfig(uint64(l)) } + l = len(m.IrohaIcs20BankAddress) + if l > 0 { + n += 1 + l + sovConfig(uint64(l)) + } + l = len(m.IrohaIcs20TransferAddress) + if l > 0 { + n += 1 + l + sovConfig(uint64(l)) + } return n } @@ -386,6 +413,70 @@ func (m *ChainConfig) Unmarshal(dAtA []byte) error { } m.IbcHandlerAddress = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field IrohaIcs20BankAddress", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowConfig + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthConfig + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthConfig + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.IrohaIcs20BankAddress = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field IrohaIcs20TransferAddress", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowConfig + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthConfig + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthConfig + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.IrohaIcs20TransferAddress = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipConfig(dAtA[iNdEx:]) diff --git a/relayer/chains/iroha/contract.go b/relayer/chains/iroha/contract.go index 53e655f..3a20ad8 100644 --- a/relayer/chains/iroha/contract.go +++ b/relayer/chains/iroha/contract.go @@ -16,6 +16,9 @@ import ( "github.com/ethereum/go-ethereum/accounts/abi" "github.com/ethereum/go-ethereum/accounts/abi/bind" "github.com/ethereum/go-ethereum/common" + + "github.com/datachainlab/iroha-ibc-modules/onchain-module/pkg/contract/irohaics20bank" + "github.com/datachainlab/iroha-ibc-modules/onchain-module/pkg/contract/irohaics20transferbank" ) type BoundContract struct { @@ -142,3 +145,51 @@ func NewIbcHandler(address common.Address, conn *rpc.Client) (*IbcHandler, error BoundContract: boundContract, }, nil } + +type IrohaIcs20Bank struct { + irohaics20bank.Irohaics20bank + BoundContract +} + +func NewIrohaIcs20Bank(address common.Address, conn *rpc.Client) (*IrohaIcs20Bank, error) { + irohaIcs20Bank, err := irohaics20bank.NewIrohaics20bank(address, ethclient.NewClient(conn)) + if err != nil { + return nil, err + } + + parsedABI, err := abi.JSON(strings.NewReader(irohaics20bank.Irohaics20bankABI)) + if err != nil { + return nil, err + } + + boundContract := NewBoundContract(address, parsedABI, conn) + + return &IrohaIcs20Bank{ + Irohaics20bank: *irohaIcs20Bank, + BoundContract: boundContract, + }, nil +} + +type IrohaIcs20Transfer struct { + irohaics20transferbank.Irohaics20transferbank + BoundContract +} + +func NewIrohaIcs20Transfer(address common.Address, conn *rpc.Client) (*IrohaIcs20Transfer, error) { + irohaIcs20TransferBank, err := irohaics20transferbank.NewIrohaics20transferbank(address, ethclient.NewClient(conn)) + if err != nil { + return nil, err + } + + parsedABI, err := abi.JSON(strings.NewReader(irohaics20transferbank.Irohaics20transferbankABI)) + if err != nil { + return nil, err + } + + boundContract := NewBoundContract(address, parsedABI, conn) + + return &IrohaIcs20Transfer{ + Irohaics20transferbank: *irohaIcs20TransferBank, + BoundContract: boundContract, + }, nil +} diff --git a/relayer/go.mod b/relayer/go.mod index b4a30c1..bd35237 100644 --- a/relayer/go.mod +++ b/relayer/go.mod @@ -3,6 +3,8 @@ module github.com/datachainlab/iroha-ibc-modules/relayer go 1.16 replace ( + github.com/datachainlab/iroha-ibc-modules/iroha-go => ../iroha-go + github.com/datachainlab/iroha-ibc-modules/onchain-module => ../onchain-module github.com/go-kit/kit => github.com/go-kit/kit v0.8.0 github.com/gogo/protobuf => github.com/regen-network/protobuf v1.3.3-alpha.regen.1 ) @@ -12,6 +14,7 @@ require ( github.com/cosmos/cosmos-sdk v0.43.0-beta1 github.com/cosmos/ibc-go v1.0.0-beta1 github.com/datachainlab/ibc-ethmultisig-client v0.1.1-0.20220302030309-1191ec233811 + github.com/datachainlab/iroha-ibc-modules/onchain-module v0.0.0-00010101000000-000000000000 github.com/ethereum/go-ethereum v1.9.25 github.com/gogo/protobuf v1.3.3 github.com/hyperledger-labs/yui-ibc-solidity v0.0.0-20220214080515-0f917e10509b diff --git a/relayer/go.sum b/relayer/go.sum index b4fcaf6..58bea2e 100644 --- a/relayer/go.sum +++ b/relayer/go.sum @@ -123,6 +123,10 @@ github.com/cloudflare/cfssl v0.0.0-20180223231731-4e2dcbde5004/go.mod h1:yMWuSON github.com/cloudflare/cloudflare-go v0.10.2-0.20190916151808-a80f83b9add9/go.mod h1:1MxXX1Ux4x6mqPmjkUgTP1CdXIBXKX7T+Jk9Gxrmx+U= github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= +github.com/cncf/udpa/go v0.0.0-20210930031921-04548b0d99d4/go.mod h1:6pvJx4me5XPnfI9Z40ddWsdw2W/uZgQLFXToKeRcDiI= +github.com/cncf/xds/go v0.0.0-20210805033703-aa0b78936158/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= +github.com/cncf/xds/go v0.0.0-20210922020428-25de7278fc84/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= +github.com/cncf/xds/go v0.0.0-20211011173535-cb28da3451f1/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/coinbase/rosetta-sdk-go v0.5.8/go.mod h1:xd4wYUhV3LkY78SPH8BUhc88rXfn2jYgN9BfiSjbcvM= github.com/coinbase/rosetta-sdk-go v0.5.9 h1:CuGQE3HFmYwdEACJnuOtVI9cofqPsGvq6FdFIzaOPKI= github.com/coinbase/rosetta-sdk-go v0.5.9/go.mod h1:xd4wYUhV3LkY78SPH8BUhc88rXfn2jYgN9BfiSjbcvM= @@ -172,6 +176,8 @@ github.com/cosmos/ledger-go v0.9.2/go.mod h1:oZJ2hHAZROdlHiwTg4t7kP+GKIIkBT+o6c9 github.com/cpuguy83/go-md2man v1.0.10/go.mod h1:SmD6nW6nTyfqj6ABTjUi3V3JVMnlJmwcJI5acqYI6dE= github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= github.com/cpuguy83/go-md2man/v2 v2.0.0/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= +github.com/crpt/go-crpt v0.1.3/go.mod h1:ijTpgRo2xIJ72uamvRspmeGUOmN86r2kJ2iTYmERdN8= +github.com/crpt/go-ed25519-sha3-512 v1.1.0/go.mod h1:oUGu0UWNhGpilJFKhxL64hR3rFKNaPCasz+qjCvvnqw= github.com/danieljoos/wincred v1.0.2 h1:zf4bhty2iLuwgjgpraD2E9UbvO+fe54XXGJbOwe23fU= github.com/danieljoos/wincred v1.0.2/go.mod h1:SnuYRW9lp1oJrZX/dXJqr0cPK5gYXqx3EJbmjhLdK9U= github.com/datachainlab/ibc-ethmultisig-client v0.1.1-0.20220302030309-1191ec233811 h1:lCyD2DkoxltTgGmHeyEoP1DtlP/bTn79WBnON9m7KPA= @@ -229,6 +235,7 @@ github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.m github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= github.com/envoyproxy/go-control-plane v0.9.9-0.20210217033140-668b12f5399d/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= +github.com/envoyproxy/go-control-plane v0.9.10-0.20210907150352-cf90f659a021/go.mod h1:AFq3mo9L8Lqqiid3OhADV3RfLJnjiw63cSpi+fDTRC0= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/ethereum/go-ethereum v1.9.23/go.mod h1:JIfVb6esrqALTExdz9hRYvrP0xBDf6wCncIu1hNwHpM= github.com/ethereum/go-ethereum v1.9.25 h1:mMiw/zOOtCLdGLWfcekua0qPrJTe7FVIiHJ4IKNTfR0= @@ -841,6 +848,7 @@ go.etcd.io/bbolt v1.3.5/go.mod h1:G5EMThwa9y8QZGBClrRx5EY+Yw9kAhnjy3bSjsnlVTQ= go.etcd.io/etcd v0.5.0-alpha.5.0.20181228115726-23731bf9ba55/go.mod h1:weASp41xM3dk0YHg1s/W8ecdGP5G4teSTMBPpYAaUgA= go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= +go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/atomic v1.5.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= @@ -879,8 +887,9 @@ golang.org/x/crypto v0.0.0-20200728195943-123391ffb6de/go.mod h1:LzIPMQfyMNhhGPh golang.org/x/crypto v0.0.0-20200820211705-5c72a883971a/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20201016220609-9e8e0b390897/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20201117144127-c1f2f97bffc9/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I= -golang.org/x/crypto v0.0.0-20201221181555-eec23a3978ad h1:DN0cp81fZ3njFcrLCytUHRSUkqBjfTo4Tx9RJTWs0EY= golang.org/x/crypto v0.0.0-20201221181555-eec23a3978ad/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I= +golang.org/x/crypto v0.0.0-20210921155107-089bfa567519 h1:7I4JAnoQBe7ZtJcBaYHi5UtiO8tQHbUSXxL+pnGRANg= +golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= @@ -936,8 +945,9 @@ golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81R golang.org/x/net v0.0.0-20200813134508-3edf25e44fcc/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20200904194848-62affa334b73/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= -golang.org/x/net v0.0.0-20201021035429-f5854403a974 h1:IX6qOQeG5uLjB/hjjwjedwfjND0hgjPMMyO1RoIXQNI= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= +golang.org/x/net v0.0.0-20210226172049-e18ecbb05110 h1:qWPm9rbaAMKs8Bq/9LRpbMqxWRVUAQwMI9fVrssnTfw= +golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -1001,12 +1011,15 @@ golang.org/x/sys v0.0.0-20200909081042-eff7692f9009/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20200922070232-aee5d888a860/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201015000850-e3ed0017c211/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210309074719-68d13333faf2 h1:46ULzRKLh1CwgRq2dC5SlBzEqqNCi8rreOZnNrbqcIY= golang.org/x/sys v0.0.0-20210309074719-68d13333faf2/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/term v0.0.0-20201117132131-f5c789dd3221 h1:/ZHdbVpdR/jk3g30/d4yUL0JU9kksj8+F/bnQUVLGDM= +golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1 h1:SrN+KX8Art/Sf4HNj6Zcz06G7VEz+7w9tdXTPOZ7+l4= +golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= +golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1 h1:v+OssWQX+hTHEmOBgwxdZxK4zHq3yOs8F9J7mk0PY8E= +golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= @@ -1101,8 +1114,11 @@ google.golang.org/grpc v1.32.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM google.golang.org/grpc v1.33.1/go.mod h1:fr5YgcSWrqhRRxogOsw7RzIpsmvOZ6IcH4kBYTpR3n0= google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv2fbc= google.golang.org/grpc v1.35.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= -google.golang.org/grpc v1.37.0 h1:uSZWeQJX5j11bIQ4AJoj+McDBo29cY1MCoC1wO3ts+c= +google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= google.golang.org/grpc v1.37.0/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM= +google.golang.org/grpc v1.43.0/go.mod h1:k+4IHHFw41K8+bbowsex27ge2rCb65oeWqe4jJ590SU= +google.golang.org/grpc v1.45.0 h1:NEpgUqV3Z+ZjkqMsxMg11IaDrXY4RY6CQukSGK0uI1M= +google.golang.org/grpc v1.45.0/go.mod h1:lN7owxKUQEqMfSyQikvvk5tf/6zMPsrK+ONuO11+0rQ= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= @@ -1154,8 +1170,9 @@ gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776 h1:tQIYjPdBoyREyB9XMu+nnTclpTYkz2zFM+lzLJFO4gQ= gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b h1:h8qDotaEPuJATrMmW04NCwg7v22aHH28wwpauUhK9Oo= +gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gotest.tools v2.2.0+incompatible/go.mod h1:DsYFclhRJ6vuDpmuTbkuFWG+y2sxOXAzmJt81HFBacw= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= diff --git a/relayer/proto/relayer/chains/iroha/config.proto b/relayer/proto/relayer/chains/iroha/config.proto index eb20692..869cb74 100644 --- a/relayer/proto/relayer/chains/iroha/config.proto +++ b/relayer/proto/relayer/chains/iroha/config.proto @@ -15,4 +15,6 @@ message ChainConfig { string ibc_host_address = 5; string ibc_handler_address = 6; + string iroha_ics20_bank_address = 7; + string iroha_ics20_transfer_address = 8; } diff --git a/scripts/init-rly b/scripts/init-rly index fa29def..11ff1ce 100755 --- a/scripts/init-rly +++ b/scripts/init-rly @@ -11,14 +11,22 @@ $RLY paths add $IBC_ZERO $IBC_ONE $PATH_NAME --file=${CONFIG_DIR}/relayer/path.j IBC_HOST_ADDRESS=$(cat ${CONTRACT_ARTIFACT_DIR}/IBCHost.json | jq -r ".networks[\"$NETWORK_ID_IBC_ZERO\"].address") IBC_HANDLER_ADDRESS=$(cat ${CONTRACT_ARTIFACT_DIR}/IBCHandler.json | jq -r ".networks[\"$NETWORK_ID_IBC_ZERO\"].address") +IROHA_ICS20_BANK_ADDRESS=$(cat ${CONTRACT_ARTIFACT_DIR}/IrohaICS20Bank.json | jq -r ".networks[\"$NETWORK_ID_IBC_ZERO\"].address") +IROHA_ICS20_TRANSFER_ADDRESS=$(cat ${CONTRACT_ARTIFACT_DIR}/IrohaICS20TransferBank.json | jq -r ".networks[\"$NETWORK_ID_IBC_ZERO\"].address") ${RLY} iroha config set-contract $IBC_ZERO \ --ibc-host $IBC_HOST_ADDRESS \ ---ibc-handler $IBC_HANDLER_ADDRESS +--ibc-handler $IBC_HANDLER_ADDRESS \ +--iroha-ics20-bank-host $IROHA_ICS20_BANK_ADDRESS \ +--iroha-ics20-transfer-handler $IROHA_ICS20_TRANSFER_ADDRESS IBC_HOST_ADDRESS=$(cat ${CONTRACT_ARTIFACT_DIR}/IBCHost.json | jq -r ".networks[\"$NETWORK_ID_IBC_ONE\"].address") IBC_HANDLER_ADDRESS=$(cat ${CONTRACT_ARTIFACT_DIR}/IBCHandler.json | jq -r ".networks[\"$NETWORK_ID_IBC_ONE\"].address") +IROHA_ICS20_BANK_ADDRESS=$(cat ${CONTRACT_ARTIFACT_DIR}/IrohaICS20Bank.json | jq -r ".networks[\"$NETWORK_ID_IBC_ONE\"].address") +IROHA_ICS20_TRANSFER_ADDRESS=$(cat ${CONTRACT_ARTIFACT_DIR}/IrohaICS20TransferBank.json | jq -r ".networks[\"$NETWORK_ID_IBC_ONE\"].address") ${RLY} iroha config set-contract $IBC_ONE \ --ibc-host $IBC_HOST_ADDRESS \ ---ibc-handler $IBC_HANDLER_ADDRESS +--ibc-handler $IBC_HANDLER_ADDRESS \ +--iroha-ics20-bank-host $IROHA_ICS20_BANK_ADDRESS \ +--iroha-ics20-transfer-handler $IROHA_ICS20_TRANSFER_ADDRESS diff --git a/web3-gateway/go.sum b/web3-gateway/go.sum index c54d842..a14e495 100644 --- a/web3-gateway/go.sum +++ b/web3-gateway/go.sum @@ -43,8 +43,6 @@ cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohl cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RXyy7KQOVs= cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= -filippo.io/edwards25519 v1.0.0-rc.1 h1:m0VOOB23frXZvAOK44usCgLWvtsxIoMCTBGJZlpmGfU= -filippo.io/edwards25519 v1.0.0-rc.1/go.mod h1:N1IkdkCkiLB6tki+MYJoSx2JTY9NUlxZE7eHn5EwJns= github.com/Azure/azure-pipeline-go v0.2.1/go.mod h1:UGSo8XybXnIGZ3epmeBw7Jdz+HiUVpqIlpz/HKHylF4= github.com/Azure/azure-pipeline-go v0.2.2/go.mod h1:4rQ/NZncSvGqNkkOsNpOU1tgoNuIlp9AfUH5G1tvCHc= github.com/Azure/azure-storage-blob-go v0.7.0/go.mod h1:f9YQKtsG1nMisotuTPpO0tjNuEjKRYAcJU8/ydDI++4= @@ -196,14 +194,10 @@ github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:ma github.com/cpuguy83/go-md2man/v2 v2.0.0/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7DoTY= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= -github.com/crpt/go-crpt v0.1.4 h1:su4MyVXEFmIcnacr5PB8wwnc29Cxf3LddkkUn1A58/w= -github.com/crpt/go-crpt v0.1.4/go.mod h1:Ue/jw4eoVJcWuB6/dcWwiYJ67L7NwdPRMtvFlr6lOZA= -github.com/crpt/go-ed25519-sha3-512 v1.1.2 h1:SlEzmoKtqcM5/w1IsRO6FUbaHRZfjwio7l4RtNW7lsc= -github.com/crpt/go-ed25519-sha3-512 v1.1.2/go.mod h1:zHtGwjnVmcxLU4Lp8VwGuvImY+RJyVBh3z4wlqJcPtY= -github.com/crpt/go-ed25519consensus v0.0.0-20211108162203-2edba5fb514d h1:Mps02xPHtl9M28lM2Uovi++tPoLVxv0vPdUhfVtQLHk= -github.com/crpt/go-ed25519consensus v0.0.0-20211108162203-2edba5fb514d/go.mod h1:LZIYMa0DBxqk27SaMwAHEqvxDyqF95aGCTOad+pBCP8= -github.com/crpt/go-ed25519consensus-sha3-512 v0.0.0-20211108155746-78fa3c0ee791 h1:rM6H7OgmsbGe88emU1DUq3Sd3n4f2inH8ffnI7B23xo= -github.com/crpt/go-ed25519consensus-sha3-512 v0.0.0-20211108155746-78fa3c0ee791/go.mod h1:3BZy+dn87cWgRuatVP3tGenTbOxCbDp3mEc4noDfzjA= +github.com/crpt/go-crpt v0.1.3 h1:WxVqphVntxUsr3lh8XbeB/ZFlhkvneFj2ke+z6LRf5s= +github.com/crpt/go-crpt v0.1.3/go.mod h1:ijTpgRo2xIJ72uamvRspmeGUOmN86r2kJ2iTYmERdN8= +github.com/crpt/go-ed25519-sha3-512 v1.1.0 h1:/45W+yYD/zHf8+M+VcH9tsISLwDVyTElIzMV2SQ5Npg= +github.com/crpt/go-ed25519-sha3-512 v1.1.0/go.mod h1:oUGu0UWNhGpilJFKhxL64hR3rFKNaPCasz+qjCvvnqw= github.com/datachainlab/burrow v0.0.0-20220222053342-657627599a4f h1:nO0RwtBQKecETSMsVy/FNR9jgLdFdjQSeXLgs6WH+rc= github.com/datachainlab/burrow v0.0.0-20220222053342-657627599a4f/go.mod h1:Zclvkg18OK8O7ch8bFyaJjsA05cLXxFZ6F683GQAJdg= github.com/davecgh/go-spew v0.0.0-20171005155431-ecdeabc65495/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=