From 312ddbf143e1cb4d58ee7b7c1d7daf11d9d1e239 Mon Sep 17 00:00:00 2001 From: Evan Gray Date: Wed, 11 Oct 2023 12:59:58 -0400 Subject: [PATCH] terra: test update --- terra/tools/package-lock.json | 359 ++++++++++++++++++++--- terra/tools/package.json | 2 +- terra/tools/test_interface_update.js | 417 +++++++++++++++++++++++++++ 3 files changed, 741 insertions(+), 37 deletions(-) create mode 100644 terra/tools/test_interface_update.js diff --git a/terra/tools/package-lock.json b/terra/tools/package-lock.json index 7cf6dad0a3..c09a85135a 100644 --- a/terra/tools/package-lock.json +++ b/terra/tools/package-lock.json @@ -1,16 +1,16 @@ { - "name": "tools", - "version": "1.0.0", + "name": "@wormhole-foundation/tools-terra", + "version": "0.0.1", "lockfileVersion": 2, "requires": true, "packages": { "": { - "name": "tools", - "version": "1.0.0", + "name": "@wormhole-foundation/tools-terra", + "version": "0.0.1", "license": "ISC", "dependencies": { "@cosmjs/encoding": "^0.26.2", - "@terra-money/terra.js": "^2.0.11", + "@terra-money/terra.js": "^3.1.3", "dotenv": "^16.0.0", "ethers": "^5.4.4", "yargs": "^17.0.1" @@ -725,12 +725,90 @@ "@ethersproject/strings": "^5.6.0" } }, + "node_modules/@improbable-eng/grpc-web": { + "version": "0.14.1", + "resolved": "https://registry.npmjs.org/@improbable-eng/grpc-web/-/grpc-web-0.14.1.tgz", + "integrity": "sha512-XaIYuunepPxoiGVLLHmlnVminUGzBTnXr8Wv7khzmLWbNw4TCwJKX09GSMJlKhu/TRk6gms0ySFxewaETSBqgw==", + "dependencies": { + "browser-headers": "^0.4.1" + }, + "peerDependencies": { + "google-protobuf": "^3.14.0" + } + }, + "node_modules/@protobufjs/aspromise": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@protobufjs/aspromise/-/aspromise-1.1.2.tgz", + "integrity": "sha512-j+gKExEuLmKwvz3OgROXtrJ2UG2x8Ch2YZUxahh+s1F2HZ+wAceUNLkvy6zKCPVRkU++ZWQrdxsUeQXmcg4uoQ==" + }, + "node_modules/@protobufjs/base64": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@protobufjs/base64/-/base64-1.1.2.tgz", + "integrity": "sha512-AZkcAA5vnN/v4PDqKyMR5lx7hZttPDgClv83E//FMNhR2TMcLUhfRUBHCmSl0oi9zMgDDqRUJkSxO3wm85+XLg==" + }, + "node_modules/@protobufjs/codegen": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/@protobufjs/codegen/-/codegen-2.0.4.tgz", + "integrity": "sha512-YyFaikqM5sH0ziFZCN3xDC7zeGaB/d0IUb9CATugHWbd1FRFwWwt4ld4OYMPWu5a3Xe01mGAULCdqhMlPl29Jg==" + }, + "node_modules/@protobufjs/eventemitter": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@protobufjs/eventemitter/-/eventemitter-1.1.0.tgz", + "integrity": "sha512-j9ednRT81vYJ9OfVuXG6ERSTdEL1xVsNgqpkxMsbIabzSo3goCjDIveeGv5d03om39ML71RdmrGNjG5SReBP/Q==" + }, + "node_modules/@protobufjs/fetch": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@protobufjs/fetch/-/fetch-1.1.0.tgz", + "integrity": "sha512-lljVXpqXebpsijW71PZaCYeIcE5on1w5DlQy5WH6GLbFryLUrBD4932W/E2BSpfRJWseIL4v/KPgBFxDOIdKpQ==", + "dependencies": { + "@protobufjs/aspromise": "^1.1.1", + "@protobufjs/inquire": "^1.1.0" + } + }, + "node_modules/@protobufjs/float": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/@protobufjs/float/-/float-1.0.2.tgz", + "integrity": "sha512-Ddb+kVXlXst9d+R9PfTIxh1EdNkgoRe5tOX6t01f1lYWOvJnSPDBlG241QLzcyPdoNTsblLUdujGSE4RzrTZGQ==" + }, + "node_modules/@protobufjs/inquire": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@protobufjs/inquire/-/inquire-1.1.0.tgz", + "integrity": "sha512-kdSefcPdruJiFMVSbn801t4vFK7KB/5gd2fYvrxhuJYg8ILrmn9SKSX2tZdV6V+ksulWqS7aXjBcRXl3wHoD9Q==" + }, + "node_modules/@protobufjs/path": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@protobufjs/path/-/path-1.1.2.tgz", + "integrity": "sha512-6JOcJ5Tm08dOHAbdR3GrvP+yUUfkjG5ePsHYczMFLq3ZmMkAD98cDgcT2iA1lJ9NVwFd4tH/iSSoe44YWkltEA==" + }, + "node_modules/@protobufjs/pool": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@protobufjs/pool/-/pool-1.1.0.tgz", + "integrity": "sha512-0kELaGSIDBKvcgS4zkjz1PeddatrjYcmMWOlAuAPwAeccUrPHdUqo/J6LiymHHEiJT5NrF1UVwxY14f+fy4WQw==" + }, + "node_modules/@protobufjs/utf8": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@protobufjs/utf8/-/utf8-1.1.0.tgz", + "integrity": "sha512-Vvn3zZrhQZkkBE8LSuW3em98c0FwgO4nxzv6OdSxPKJIEKY2bGbHn+mhGIPerzI4twdxaP8/0+06HBpwf345Lw==" + }, + "node_modules/@terra-money/legacy.proto": { + "name": "@terra-money/terra.proto", + "version": "0.1.7", + "resolved": "https://registry.npmjs.org/@terra-money/terra.proto/-/terra.proto-0.1.7.tgz", + "integrity": "sha512-NXD7f6pQCulvo6+mv6MAPzhOkUzRjgYVuHZE/apih+lVnPG5hDBU0rRYnOGGofwvKT5/jQoOENnFn/gioWWnyQ==", + "dependencies": { + "google-protobuf": "^3.17.3", + "long": "^4.0.0", + "protobufjs": "~6.11.2" + } + }, "node_modules/@terra-money/terra.js": { - "version": "2.0.11", - "resolved": "https://registry.npmjs.org/@terra-money/terra.js/-/terra.js-2.0.11.tgz", - "integrity": "sha512-33MrW3SGEmbHzjAA93dw1VA6IKbp6gYJbOTUkQzQbi+msIUf4m9ZewB6v5b8UZJfTfEe/T5RjXCWQHmANsz11w==", + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/@terra-money/terra.js/-/terra.js-3.1.3.tgz", + "integrity": "sha512-80HU5WXrqf3hZTo2GRhIycH17A+SkLD6afbu8MynMDGGD/A861F3zVv6NQ/Z7PWQGHxgddZEK/A0UQ2uK/xfHg==", "dependencies": { - "axios": "^0.21.1", + "@terra-money/legacy.proto": "npm:@terra-money/terra.proto@^0.1.7", + "@terra-money/terra.proto": "~2.0.0", + "axios": "^0.26.1", "bech32": "^2.0.0", "bip32": "^2.0.6", "bip39": "^3.0.3", @@ -741,12 +819,28 @@ "secp256k1": "^4.0.2", "tmp": "^0.2.1", "utf-8-validate": "^5.0.5", - "ws": "^7.4.2" + "ws": "^7.5.5" }, "engines": { - "node": ">=12" + "node": ">=14" + } + }, + "node_modules/@terra-money/terra.proto": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@terra-money/terra.proto/-/terra.proto-2.0.0.tgz", + "integrity": "sha512-ZjyFOFUzrGn8IwzGIgr1OJFcPSsQoz/XAfoSKThJx+OjJA7CLhdcz51+5h7ehNfb+qB9wr7aNME0h24wu9D4SQ==", + "dependencies": { + "@improbable-eng/grpc-web": "^0.14.1", + "google-protobuf": "^3.17.3", + "long": "^4.0.0", + "protobufjs": "~6.11.2" } }, + "node_modules/@types/long": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/@types/long/-/long-4.0.2.tgz", + "integrity": "sha512-MqTGEo5bj5t157U6fA/BiDynNkn0YknVdh48CMPkTSpFTVmvao5UQmm7uEF6xBEo7qIMAlY/JSleYaE6VOdpaA==" + }, "node_modules/@types/node": { "version": "10.12.18", "resolved": "https://registry.npmjs.org/@types/node/-/node-10.12.18.tgz", @@ -780,11 +874,11 @@ } }, "node_modules/axios": { - "version": "0.21.4", - "resolved": "https://registry.npmjs.org/axios/-/axios-0.21.4.tgz", - "integrity": "sha512-ut5vewkiu8jjGBdqpM44XxjuCjq9LAKeHVmoVfHVzy8eHgxxq8SbAVQNovDA8mVi05kP0Ea/n/UzcSHcTJQfNg==", + "version": "0.26.1", + "resolved": "https://registry.npmjs.org/axios/-/axios-0.26.1.tgz", + "integrity": "sha512-fPwcX4EvnSHuInCMItEhAGnaSEXRBjtzh9fOtsE6E1G6p7vl7edEeZe11QHf18+6+9gR5PbKV/sGKNaD8YaMeA==", "dependencies": { - "follow-redirects": "^1.14.0" + "follow-redirects": "^1.14.8" } }, "node_modules/balanced-match": { @@ -884,6 +978,11 @@ "resolved": "https://registry.npmjs.org/brorand/-/brorand-1.1.0.tgz", "integrity": "sha1-EsJe/kCkXjwyPrhnWgoM5XsiNx8=" }, + "node_modules/browser-headers": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/browser-headers/-/browser-headers-0.4.1.tgz", + "integrity": "sha512-CA9hsySZVo9371qEHjHZtYxV2cFtVj5Wj/ZHi8ooEsrtm4vOnl9Y9HmyYWk9q+05d7K3rdoAE0j3MVEFVvtQtg==" + }, "node_modules/bs58": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/bs58/-/bs58-4.0.1.tgz", @@ -1072,9 +1171,9 @@ "integrity": "sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw==" }, "node_modules/follow-redirects": { - "version": "1.14.4", - "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.14.4.tgz", - "integrity": "sha512-zwGkiSXC1MUJG/qmeIFH2HBJx9u0V46QGUe3YR1fXG8bXQxq7fLj0RjLZQ5nubr9qNJUZrH+xUcwXEoXNpfS+g==", + "version": "1.15.3", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.3.tgz", + "integrity": "sha512-1VzOtuEM8pC9SFU1E+8KfTjZyMztRsgEfwQl44z8A25uy13jSzTj6dyK2Df52iV0vgHCfBwLhDWevLn95w5v6Q==", "funding": [ { "type": "individual", @@ -1122,6 +1221,11 @@ "url": "https://github.com/sponsors/isaacs" } }, + "node_modules/google-protobuf": { + "version": "3.21.2", + "resolved": "https://registry.npmjs.org/google-protobuf/-/google-protobuf-3.21.2.tgz", + "integrity": "sha512-3MSOYFO5U9mPGikIYCzK0SaThypfGgS6bHqrUGXG3DPHCrb+txNqeEcns1W0lkGfk0rCyNXm7xB9rMxnCiZOoA==" + }, "node_modules/hash-base": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/hash-base/-/hash-base-3.1.0.tgz", @@ -1189,6 +1293,11 @@ "jscrypto": "bin/cli.js" } }, + "node_modules/long": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/long/-/long-4.0.0.tgz", + "integrity": "sha512-XsP+KhQif4bjX1kbuSiySJFNAehNxgLb6hPRGJ9QsUr8ajHkuXGdrHmFUTUUXhDwVX2R5bY4JNZEwbUiMhV+MA==" + }, "node_modules/md5.js": { "version": "1.3.5", "resolved": "https://registry.npmjs.org/md5.js/-/md5.js-1.3.5.tgz", @@ -1271,6 +1380,39 @@ "node": ">=0.12" } }, + "node_modules/protobufjs": { + "version": "6.11.4", + "resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-6.11.4.tgz", + "integrity": "sha512-5kQWPaJHi1WoCpjTGszzQ32PG2F4+wRY6BmAT4Vfw56Q2FZ4YZzK20xUYQH4YkfehY1e6QSICrJquM6xXZNcrw==", + "hasInstallScript": true, + "dependencies": { + "@protobufjs/aspromise": "^1.1.2", + "@protobufjs/base64": "^1.1.2", + "@protobufjs/codegen": "^2.0.4", + "@protobufjs/eventemitter": "^1.1.0", + "@protobufjs/fetch": "^1.1.0", + "@protobufjs/float": "^1.0.2", + "@protobufjs/inquire": "^1.1.0", + "@protobufjs/path": "^1.1.2", + "@protobufjs/pool": "^1.1.0", + "@protobufjs/utf8": "^1.1.0", + "@types/long": "^4.0.1", + "@types/node": ">=13.7.0", + "long": "^4.0.0" + }, + "bin": { + "pbjs": "bin/pbjs", + "pbts": "bin/pbts" + } + }, + "node_modules/protobufjs/node_modules/@types/node": { + "version": "20.8.4", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.8.4.tgz", + "integrity": "sha512-ZVPnqU58giiCjSxjVUESDtdPk4QR5WQhhINbc9UBrKLU68MX5BF6kbQzTrkwbolyr0X8ChBpXfavr5mZFKZQ5A==", + "dependencies": { + "undici-types": "~5.25.1" + } + }, "node_modules/randombytes": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz", @@ -1442,6 +1584,11 @@ "resolved": "https://registry.npmjs.org/typeforce/-/typeforce-1.18.0.tgz", "integrity": "sha512-7uc1O8h1M1g0rArakJdf0uLRSSgFcYexrVoKo+bzJd32gd4gDy2L/Z+8/FjPnU9ydY3pEnVPtr9FyscYY60K1g==" }, + "node_modules/undici-types": { + "version": "5.25.3", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.25.3.tgz", + "integrity": "sha512-Ga1jfYwRn7+cP9v8auvEXN1rX3sWqlayd4HP7OKk4mZWylEmu3KzXDUGrQUN6Ol7qo1gPvB2e5gX6udnyEPgdA==" + }, "node_modules/utf-8-validate": { "version": "5.0.6", "resolved": "https://registry.npmjs.org/utf-8-validate/-/utf-8-validate-5.0.6.tgz", @@ -1489,9 +1636,9 @@ "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=" }, "node_modules/ws": { - "version": "7.5.5", - "resolved": "https://registry.npmjs.org/ws/-/ws-7.5.5.tgz", - "integrity": "sha512-BAkMFcAzl8as1G/hArkxOxq3G7pjUqQ3gzYbLL0/5zNkph70e+lCoxBGnm6AW1+/aiNeV4fnKqZ8m4GZewmH2w==", + "version": "7.5.9", + "resolved": "https://registry.npmjs.org/ws/-/ws-7.5.9.tgz", + "integrity": "sha512-F+P9Jil7UiSKSkppIiD94dN07AwvFixvLIj1Og1Rl9GGMuNipJnV9JzjD6XuqmAeiswGvUmNLjr5cFuXwNS77Q==", "engines": { "node": ">=8.3.0" }, @@ -1942,12 +2089,86 @@ "@ethersproject/strings": "^5.6.0" } }, + "@improbable-eng/grpc-web": { + "version": "0.14.1", + "resolved": "https://registry.npmjs.org/@improbable-eng/grpc-web/-/grpc-web-0.14.1.tgz", + "integrity": "sha512-XaIYuunepPxoiGVLLHmlnVminUGzBTnXr8Wv7khzmLWbNw4TCwJKX09GSMJlKhu/TRk6gms0ySFxewaETSBqgw==", + "requires": { + "browser-headers": "^0.4.1" + } + }, + "@protobufjs/aspromise": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@protobufjs/aspromise/-/aspromise-1.1.2.tgz", + "integrity": "sha512-j+gKExEuLmKwvz3OgROXtrJ2UG2x8Ch2YZUxahh+s1F2HZ+wAceUNLkvy6zKCPVRkU++ZWQrdxsUeQXmcg4uoQ==" + }, + "@protobufjs/base64": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@protobufjs/base64/-/base64-1.1.2.tgz", + "integrity": "sha512-AZkcAA5vnN/v4PDqKyMR5lx7hZttPDgClv83E//FMNhR2TMcLUhfRUBHCmSl0oi9zMgDDqRUJkSxO3wm85+XLg==" + }, + "@protobufjs/codegen": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/@protobufjs/codegen/-/codegen-2.0.4.tgz", + "integrity": "sha512-YyFaikqM5sH0ziFZCN3xDC7zeGaB/d0IUb9CATugHWbd1FRFwWwt4ld4OYMPWu5a3Xe01mGAULCdqhMlPl29Jg==" + }, + "@protobufjs/eventemitter": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@protobufjs/eventemitter/-/eventemitter-1.1.0.tgz", + "integrity": "sha512-j9ednRT81vYJ9OfVuXG6ERSTdEL1xVsNgqpkxMsbIabzSo3goCjDIveeGv5d03om39ML71RdmrGNjG5SReBP/Q==" + }, + "@protobufjs/fetch": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@protobufjs/fetch/-/fetch-1.1.0.tgz", + "integrity": "sha512-lljVXpqXebpsijW71PZaCYeIcE5on1w5DlQy5WH6GLbFryLUrBD4932W/E2BSpfRJWseIL4v/KPgBFxDOIdKpQ==", + "requires": { + "@protobufjs/aspromise": "^1.1.1", + "@protobufjs/inquire": "^1.1.0" + } + }, + "@protobufjs/float": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/@protobufjs/float/-/float-1.0.2.tgz", + "integrity": "sha512-Ddb+kVXlXst9d+R9PfTIxh1EdNkgoRe5tOX6t01f1lYWOvJnSPDBlG241QLzcyPdoNTsblLUdujGSE4RzrTZGQ==" + }, + "@protobufjs/inquire": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@protobufjs/inquire/-/inquire-1.1.0.tgz", + "integrity": "sha512-kdSefcPdruJiFMVSbn801t4vFK7KB/5gd2fYvrxhuJYg8ILrmn9SKSX2tZdV6V+ksulWqS7aXjBcRXl3wHoD9Q==" + }, + "@protobufjs/path": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@protobufjs/path/-/path-1.1.2.tgz", + "integrity": "sha512-6JOcJ5Tm08dOHAbdR3GrvP+yUUfkjG5ePsHYczMFLq3ZmMkAD98cDgcT2iA1lJ9NVwFd4tH/iSSoe44YWkltEA==" + }, + "@protobufjs/pool": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@protobufjs/pool/-/pool-1.1.0.tgz", + "integrity": "sha512-0kELaGSIDBKvcgS4zkjz1PeddatrjYcmMWOlAuAPwAeccUrPHdUqo/J6LiymHHEiJT5NrF1UVwxY14f+fy4WQw==" + }, + "@protobufjs/utf8": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@protobufjs/utf8/-/utf8-1.1.0.tgz", + "integrity": "sha512-Vvn3zZrhQZkkBE8LSuW3em98c0FwgO4nxzv6OdSxPKJIEKY2bGbHn+mhGIPerzI4twdxaP8/0+06HBpwf345Lw==" + }, + "@terra-money/legacy.proto": { + "version": "npm:@terra-money/terra.proto@0.1.7", + "resolved": "https://registry.npmjs.org/@terra-money/terra.proto/-/terra.proto-0.1.7.tgz", + "integrity": "sha512-NXD7f6pQCulvo6+mv6MAPzhOkUzRjgYVuHZE/apih+lVnPG5hDBU0rRYnOGGofwvKT5/jQoOENnFn/gioWWnyQ==", + "requires": { + "google-protobuf": "^3.17.3", + "long": "^4.0.0", + "protobufjs": "~6.11.2" + } + }, "@terra-money/terra.js": { - "version": "2.0.11", - "resolved": "https://registry.npmjs.org/@terra-money/terra.js/-/terra.js-2.0.11.tgz", - "integrity": "sha512-33MrW3SGEmbHzjAA93dw1VA6IKbp6gYJbOTUkQzQbi+msIUf4m9ZewB6v5b8UZJfTfEe/T5RjXCWQHmANsz11w==", + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/@terra-money/terra.js/-/terra.js-3.1.3.tgz", + "integrity": "sha512-80HU5WXrqf3hZTo2GRhIycH17A+SkLD6afbu8MynMDGGD/A861F3zVv6NQ/Z7PWQGHxgddZEK/A0UQ2uK/xfHg==", "requires": { - "axios": "^0.21.1", + "@terra-money/legacy.proto": "npm:@terra-money/terra.proto@^0.1.7", + "@terra-money/terra.proto": "~2.0.0", + "axios": "^0.26.1", "bech32": "^2.0.0", "bip32": "^2.0.6", "bip39": "^3.0.3", @@ -1958,9 +2179,25 @@ "secp256k1": "^4.0.2", "tmp": "^0.2.1", "utf-8-validate": "^5.0.5", - "ws": "^7.4.2" + "ws": "^7.5.5" } }, + "@terra-money/terra.proto": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@terra-money/terra.proto/-/terra.proto-2.0.0.tgz", + "integrity": "sha512-ZjyFOFUzrGn8IwzGIgr1OJFcPSsQoz/XAfoSKThJx+OjJA7CLhdcz51+5h7ehNfb+qB9wr7aNME0h24wu9D4SQ==", + "requires": { + "@improbable-eng/grpc-web": "^0.14.1", + "google-protobuf": "^3.17.3", + "long": "^4.0.0", + "protobufjs": "~6.11.2" + } + }, + "@types/long": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/@types/long/-/long-4.0.2.tgz", + "integrity": "sha512-MqTGEo5bj5t157U6fA/BiDynNkn0YknVdh48CMPkTSpFTVmvao5UQmm7uEF6xBEo7qIMAlY/JSleYaE6VOdpaA==" + }, "@types/node": { "version": "10.12.18", "resolved": "https://registry.npmjs.org/@types/node/-/node-10.12.18.tgz", @@ -1985,11 +2222,11 @@ } }, "axios": { - "version": "0.21.4", - "resolved": "https://registry.npmjs.org/axios/-/axios-0.21.4.tgz", - "integrity": "sha512-ut5vewkiu8jjGBdqpM44XxjuCjq9LAKeHVmoVfHVzy8eHgxxq8SbAVQNovDA8mVi05kP0Ea/n/UzcSHcTJQfNg==", + "version": "0.26.1", + "resolved": "https://registry.npmjs.org/axios/-/axios-0.26.1.tgz", + "integrity": "sha512-fPwcX4EvnSHuInCMItEhAGnaSEXRBjtzh9fOtsE6E1G6p7vl7edEeZe11QHf18+6+9gR5PbKV/sGKNaD8YaMeA==", "requires": { - "follow-redirects": "^1.14.0" + "follow-redirects": "^1.14.8" } }, "balanced-match": { @@ -2074,6 +2311,11 @@ "resolved": "https://registry.npmjs.org/brorand/-/brorand-1.1.0.tgz", "integrity": "sha1-EsJe/kCkXjwyPrhnWgoM5XsiNx8=" }, + "browser-headers": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/browser-headers/-/browser-headers-0.4.1.tgz", + "integrity": "sha512-CA9hsySZVo9371qEHjHZtYxV2cFtVj5Wj/ZHi8ooEsrtm4vOnl9Y9HmyYWk9q+05d7K3rdoAE0j3MVEFVvtQtg==" + }, "bs58": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/bs58/-/bs58-4.0.1.tgz", @@ -2239,9 +2481,9 @@ "integrity": "sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw==" }, "follow-redirects": { - "version": "1.14.4", - "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.14.4.tgz", - "integrity": "sha512-zwGkiSXC1MUJG/qmeIFH2HBJx9u0V46QGUe3YR1fXG8bXQxq7fLj0RjLZQ5nubr9qNJUZrH+xUcwXEoXNpfS+g==" + "version": "1.15.3", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.3.tgz", + "integrity": "sha512-1VzOtuEM8pC9SFU1E+8KfTjZyMztRsgEfwQl44z8A25uy13jSzTj6dyK2Df52iV0vgHCfBwLhDWevLn95w5v6Q==" }, "fs.realpath": { "version": "1.0.0", @@ -2266,6 +2508,11 @@ "path-is-absolute": "^1.0.0" } }, + "google-protobuf": { + "version": "3.21.2", + "resolved": "https://registry.npmjs.org/google-protobuf/-/google-protobuf-3.21.2.tgz", + "integrity": "sha512-3MSOYFO5U9mPGikIYCzK0SaThypfGgS6bHqrUGXG3DPHCrb+txNqeEcns1W0lkGfk0rCyNXm7xB9rMxnCiZOoA==" + }, "hash-base": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/hash-base/-/hash-base-3.1.0.tgz", @@ -2324,6 +2571,11 @@ "resolved": "https://registry.npmjs.org/jscrypto/-/jscrypto-1.0.2.tgz", "integrity": "sha512-r+oNJLGTv1nkNMBBq3c70xYrFDgJOYVgs2OHijz5Ht+0KJ0yObD0oYxC9mN72KLzVfXw+osspg6t27IZvuTUxw==" }, + "long": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/long/-/long-4.0.0.tgz", + "integrity": "sha512-XsP+KhQif4bjX1kbuSiySJFNAehNxgLb6hPRGJ9QsUr8ajHkuXGdrHmFUTUUXhDwVX2R5bY4JNZEwbUiMhV+MA==" + }, "md5.js": { "version": "1.3.5", "resolved": "https://registry.npmjs.org/md5.js/-/md5.js-1.3.5.tgz", @@ -2392,6 +2644,36 @@ "sha.js": "^2.4.8" } }, + "protobufjs": { + "version": "6.11.4", + "resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-6.11.4.tgz", + "integrity": "sha512-5kQWPaJHi1WoCpjTGszzQ32PG2F4+wRY6BmAT4Vfw56Q2FZ4YZzK20xUYQH4YkfehY1e6QSICrJquM6xXZNcrw==", + "requires": { + "@protobufjs/aspromise": "^1.1.2", + "@protobufjs/base64": "^1.1.2", + "@protobufjs/codegen": "^2.0.4", + "@protobufjs/eventemitter": "^1.1.0", + "@protobufjs/fetch": "^1.1.0", + "@protobufjs/float": "^1.0.2", + "@protobufjs/inquire": "^1.1.0", + "@protobufjs/path": "^1.1.2", + "@protobufjs/pool": "^1.1.0", + "@protobufjs/utf8": "^1.1.0", + "@types/long": "^4.0.1", + "@types/node": ">=13.7.0", + "long": "^4.0.0" + }, + "dependencies": { + "@types/node": { + "version": "20.8.4", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.8.4.tgz", + "integrity": "sha512-ZVPnqU58giiCjSxjVUESDtdPk4QR5WQhhINbc9UBrKLU68MX5BF6kbQzTrkwbolyr0X8ChBpXfavr5mZFKZQ5A==", + "requires": { + "undici-types": "~5.25.1" + } + } + } + }, "randombytes": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz", @@ -2517,6 +2799,11 @@ "resolved": "https://registry.npmjs.org/typeforce/-/typeforce-1.18.0.tgz", "integrity": "sha512-7uc1O8h1M1g0rArakJdf0uLRSSgFcYexrVoKo+bzJd32gd4gDy2L/Z+8/FjPnU9ydY3pEnVPtr9FyscYY60K1g==" }, + "undici-types": { + "version": "5.25.3", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.25.3.tgz", + "integrity": "sha512-Ga1jfYwRn7+cP9v8auvEXN1rX3sWqlayd4HP7OKk4mZWylEmu3KzXDUGrQUN6Ol7qo1gPvB2e5gX6udnyEPgdA==" + }, "utf-8-validate": { "version": "5.0.6", "resolved": "https://registry.npmjs.org/utf-8-validate/-/utf-8-validate-5.0.6.tgz", @@ -2554,9 +2841,9 @@ "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=" }, "ws": { - "version": "7.5.5", - "resolved": "https://registry.npmjs.org/ws/-/ws-7.5.5.tgz", - "integrity": "sha512-BAkMFcAzl8as1G/hArkxOxq3G7pjUqQ3gzYbLL0/5zNkph70e+lCoxBGnm6AW1+/aiNeV4fnKqZ8m4GZewmH2w==", + "version": "7.5.9", + "resolved": "https://registry.npmjs.org/ws/-/ws-7.5.9.tgz", + "integrity": "sha512-F+P9Jil7UiSKSkppIiD94dN07AwvFixvLIj1Og1Rl9GGMuNipJnV9JzjD6XuqmAeiswGvUmNLjr5cFuXwNS77Q==", "requires": {} }, "y18n": { diff --git a/terra/tools/package.json b/terra/tools/package.json index 4a2a4963d2..46a7f963a9 100644 --- a/terra/tools/package.json +++ b/terra/tools/package.json @@ -11,7 +11,7 @@ "license": "ISC", "dependencies": { "@cosmjs/encoding": "^0.26.2", - "@terra-money/terra.js": "^2.0.11", + "@terra-money/terra.js": "^3.1.3", "dotenv": "^16.0.0", "ethers": "^5.4.4", "yargs": "^17.0.1" diff --git a/terra/tools/test_interface_update.js b/terra/tools/test_interface_update.js new file mode 100644 index 0000000000..b742b01820 --- /dev/null +++ b/terra/tools/test_interface_update.js @@ -0,0 +1,417 @@ +import "dotenv/config"; +import { + Fee, + LCDClient, + MnemonicKey, + MsgUpdateContractAdmin, +} from "@terra-money/terra.js"; +import { + MsgInstantiateContract, + MsgExecuteContract, + MsgStoreCode, +} from "@terra-money/terra.js"; +import { readFileSync } from "fs"; +import { Bech32, toHex } from "@cosmjs/encoding"; +import { zeroPad } from "ethers/lib/utils.js"; + +// gas estimation wasn't working, so you'll find many hardcoded values in here +// YMMV + +function sleep(ms) { + return new Promise((resolve) => setTimeout(resolve, ms)); +} + +// look, broadcast and broadcastBlock still resulted in sequence mismatches +// and nobody has time for that +async function broadcastAndWait(terra, tx) { + const response = await terra.tx.broadcast(tx); + let currentHeight = (await terra.tendermint.blockInfo()).block.header.height; + while (currentHeight <= response.height) { + await sleep(100); + currentHeight = (await terra.tendermint.blockInfo()).block.header.height; + } + return response; +} + +// Terra addresses are "human-readable", but for cross-chain registrations, we +// want the "canonical" version +function convert_terra_address_to_hex(human_addr) { + return "0x" + toHex(zeroPad(Bech32.decode(human_addr).data, 32)); +} + +const artifacts = [ + // "wormhole.wasm", + // "token_bridge_terra.wasm", + // "cw20_wrapped.wasm", +]; + +/* Set up terra client & wallet */ + +const terra = new LCDClient({ + URL: "https://terra-classic-lcd.publicnode.com", + chainID: "columbus-5", + isClassic: false, +}); + +const wallet = terra.wallet( + new MnemonicKey({ + mnemonic: process.env.MNEMONIC, + }) +); + +/* Deploy artifacts */ + +// const codeIds = {}; +const codeIds = { + "wormhole.wasm": 557, // current wasm + // "wormhole.wasm": 8143, // new wasm + "token_bridge_terra.wasm": 8144, + "cw20_wrapped.wasm": 767, // old wasm + // "cw20_wrapped.wasm": 8145, // new wasm +}; + +for (const file of artifacts) { + const contract_bytes = readFileSync(`../artifacts/${file}`); + console.log(`Storing WASM: ${file} (${contract_bytes.length} bytes)`); + + const store_code = new MsgStoreCode( + wallet.key.accAddress, + contract_bytes.toString("base64") + ); + + const tx = await wallet.createAndSignTx({ + msgs: [store_code], + memo: "", + fee: new Fee(5000000, { uluna: 200_000_000 }), + }); + + const rs = await broadcastAndWait(terra, tx); + console.log(rs.raw_log); + const ci = /"code_id","value":"([^"]+)/gm.exec(rs.raw_log)[1]; + codeIds[file] = parseInt(ci); +} + +console.log(codeIds); + +/* Instantiate contracts. + * + * We instantiate the core contracts here (i.e. wormhole itself and the bridge contracts). + * The wrapped asset contracts don't need to be instantiated here, because those + * will be instantiated by the on-chain bridge contracts on demand. + * */ + +// Governance constants defined by the Wormhole spec. +const govChain = 1; +const govAddress = + "0000000000000000000000000000000000000000000000000000000000000004"; + +async function instantiate(contract, inst_msg, label) { + var address; + await wallet + .createAndSignTx({ + msgs: [ + new MsgInstantiateContract( + wallet.key.accAddress, + wallet.key.accAddress, + codeIds[contract], + inst_msg, + undefined, + label + ), + ], + memo: "", + fee: new Fee(5000000, { uluna: 200_000_000 }), + }) + .then((tx) => broadcastAndWait(terra, tx)) + .then((rs) => { + address = /"_contract_address","value":"([^"]+)/gm.exec(rs.raw_log)[1]; + }); + console.log( + `Instantiated ${contract} at ${address} (${convert_terra_address_to_hex( + address + )})` + ); + return address; +} + +// Instantiate contracts + +// const addresses = {}; +const addresses = { + // TEST SETUP 1 + // existing core + "wormhole.wasm": "terra1dq03ugtd40zu9hcgdzrsq6z2z4hwhc9tqk2uy5", + // against existing core + // "token_bridge_terra.wasm": + // "terra1hqjsuypxjyhjqxcph3at0d5jw84yhd3h7hzrvw0xhhsr9vc0l39s63zsu0", + + // TEST SETUP 2 + // // new build + // "wormhole.wasm": + // "terra1stflcrlulqs9xpy63e9ey3ynrpd2249527sf79xth8w58ykqkwxq7ry7q7", + // // against new core + // "token_bridge_terra.wasm": + // "terra146np8yvga9rv28urzh5wm54h9h9zm0xg9dmvl6ruydfreqn6eyxqjq5vgw", + + // TEST SETUP 3 + // // old code id + // "wormhole.wasm": + // "terra1h940amys4jv0ytcfrd3n66545d4rx6w7u39c9xr2gmsl2w8ng0jql9c970", + // // against old core code + // "token_bridge_terra.wasm": + // "terra10ljyg6atu6jrxmzr0v0ln03tvgh6dp7uslfmngz5vhnag4p5l80qk0pt9n", +}; + +// // devnet guardian public key +// const init_guardians = ["beFA429d57cD18b7F8A4d91A2da9AB4AF05d0FBe"]; + +// addresses["wormhole.wasm"] = await instantiate( +// "wormhole.wasm", +// { +// gov_chain: govChain, +// gov_address: Buffer.from(govAddress, "hex").toString("base64"), +// guardian_set_expirity: 86400, +// initial_guardian_set: { +// addresses: init_guardians.map((hex) => { +// return { +// bytes: Buffer.from(hex, "hex").toString("base64"), +// }; +// }), +// expiration_time: 0, +// }, +// }, +// "wormholeTest" +// ); + +addresses["token_bridge_terra.wasm"] = await instantiate( + "token_bridge_terra.wasm", + { + // gov_chain: govChain, + // gov_address: Buffer.from(govAddress, "hex").toString("base64"), + gov_chain: 6, + gov_address: Buffer.from( + "00000000000000000000000049887a216375fded17dc1aaad4920c3777265614", + "hex" + ).toString("base64"), + wormhole_contract: addresses["wormhole.wasm"], + wrapped_asset_code_id: codeIds["cw20_wrapped.wasm"], + }, + "tokenBridgeTest" +); + +/* Registrations: tell the bridge contracts to know about each other */ + +const contract_registrations = { + "token_bridge_terra.wasm": [ + // Solana devnet token bridge registration + // "01000000000100c9f4230109e378f7efc0605fb40f0e1869f2d82fda5b1dfad8a5a2dafee85e033d155c18641165a77a2db6a7afbf2745b458616cb59347e89ae0c7aa3e7cc2d400000000010000000100010000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000546f6b656e4272696467650100000001c69a1b1a65dd336bf1df6a77afb501fc25db7fc0938cb08595a9ef473265cb4f", + // Ethereum devnet token bridge registration + // "01000000000100e2e1975d14734206e7a23d90db48a6b5b6696df72675443293c6057dcb936bf224b5df67d32967adeb220d4fe3cb28be515be5608c74aab6adb31099a478db5c01000000010000000100010000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000546f6b656e42726964676501000000020000000000000000000000000290fb167208af455bb137780163b7b7a9a10c16", + // Avalanche mainnet token bridge registration + "01000000030d022fa91e5df8ef1a320710730c63143c72e8ac8309546c7b36e3a974cc42ae3188169bba1d62afb5a9d04d09cea0b6fdd5fbff9bd3828b9e43d40c66b4a7ac4188010355e8a4edb5de6ce386ba67204da0fb15559b43788cdd0471fdd560c4c5aa81307a6be777fc8f525fee0f79faef62f1a91f99465f84dad8ebb53b4df68a5322390104570a49a223c855bf61fefce149e52efab20d8be703f5a0decfb0cdcffea75cd9418ac7f375a8ddff481eb19494f0ada6532aa2bfcb8f5fe7d79ffa42bcb69d8b000559cf3254735ba37c09512da6cba3417892cef2d8cee64721d85bb652233965ce38d9ef1db109b138bd4a8a75bf05e414ea0123eda9ed673295d16aee13e2b0cd0106b9e38f4a941c104b1b2077061cf5212f4684795b90220f078fa4d38d08fe2080526c82bf9608197e594bb1e575789d201408ccdf56bf323b64ef173c6c75dd44010761d86f30d709fa3304322eb68d5e319af6696291a2c27d3d94314d3a94af6f9b19b60e64d4eabc8a3334f5baf6b087605b51ed3d0fa1049a6711645d81773bff0108216485ceff70b54f363e49c00a5418cce3f460092f119e2049eb5ca56b8bf4d358e57b7180a97ade4700bee8b77d047515e63e83849039a4b2527a349ef6d1640109c8990d7c964186a264ffa01291a23ef8ff644830d76a6b9d17dff6455bcb67271913c099e3597656ab2016152f55af78861e513787847f645bacaa3193c053bb010c847815ab7ce77f9151fbd35fff9767f73035dbc76c0683e1efedc89eb16c93284de384ad6de521200a1cef67279a1d41b714b3e3e558796bd287243453b81a2c000d721ffed26dc5f06ee8858b9595c8a57870f663f10f03e2ad078679a6373b24ee457eafe4bdcc7005f2a2cfb674f0c29394a64c21c81a59824965566e6859dcf0000f28f1f759bc52cc011fcaba0482cd4c3012e9474cc5089b185747d848e998e72231a0c8dab79041bbe804c13032411afd78a386df08ac517939828a62effb22b60110720e9720728dd34858fa83e292730b64991ec9bc8c2f999ab3bf3873f2254e4972c097153e9dfa4cb9b6ab2e2ffd8d9483ac7d6002754795e41fd4aab001f9c6011161cc391d56aead20f0e1169e759cb320277afaf9cf08adb31db58040eb2c97042cf92037df376c87c65e386ec0eb26e22e4ce5d9ace143c02a26612a3d2cab81000000000032bda66200010000000000000000000000000000000000000000000000000000000000000004e2dcca3b0a7d091320000000000000000000000000000000000000000000546f6b656e42726964676501000000060000000000000000000000000e082f06ff657d94310cb8ce8b0d9a04541d8052", + ], +}; + +for (const [contract, registrations] of Object.entries( + contract_registrations +)) { + console.log(`Registering chains for ${contract}:`); + for (const registration of registrations) { + await wallet + .createAndSignTx({ + msgs: [ + new MsgExecuteContract( + wallet.key.accAddress, + addresses[contract], + { + submit_vaa: { + data: Buffer.from(registration, "hex").toString("base64"), + }, + }, + { uluna: 1000 } + ), + ], + memo: "", + fee: new Fee(500000, { uluna: 20_000_000 }), + }) + .then((tx) => broadcastAndWait(terra, tx)) + .then((rs) => console.log(rs)); + } +} + +/* Test sending a message */ + +await wallet + .createAndSignTx({ + msgs: [ + new MsgExecuteContract( + wallet.key.accAddress, + addresses["wormhole.wasm"], + { + post_message: { + message: Buffer.from("hello", "ascii").toString("base64"), + nonce: 1, + }, + }, + {} + // { uluna: 10000 } // if fee is set (old code id newly initialized) + ), + ], + memo: "", + fee: new Fee(200000, { uluna: 10_000_000 }), + }) + .then((tx) => broadcastAndWait(terra, tx)) + .then((rs) => console.log(rs)); + +/* Test depositing and withdrawing native tokens */ + +await wallet + .createAndSignTx({ + msgs: [ + new MsgExecuteContract( + wallet.key.accAddress, + addresses["token_bridge_terra.wasm"], + { + deposit_tokens: {}, + }, + { uluna: 10000 } + ), + ], + memo: "", + fee: new Fee(200000, { uluna: 10_000_000 }), + }) + .then((tx) => broadcastAndWait(terra, tx)) + .then((rs) => console.log(rs)); + +await wallet + .createAndSignTx({ + msgs: [ + new MsgExecuteContract( + wallet.key.accAddress, + addresses["token_bridge_terra.wasm"], + { + withdraw_tokens: { + asset: { + native_token: { + denom: "uluna", + }, + }, + }, + }, + {} + ), + ], + memo: "", + fee: new Fee(200000, { uluna: 10_000_000 }), + }) + .then((tx) => broadcastAndWait(terra, tx)) + .then((rs) => console.log(rs)); + +/* Test sending and receiving native tokens */ + +await wallet + .createAndSignTx({ + msgs: [ + new MsgExecuteContract( + wallet.key.accAddress, + addresses["token_bridge_terra.wasm"], + { + deposit_tokens: {}, + }, + { uluna: 10000 } + ), + new MsgExecuteContract( + wallet.key.accAddress, + addresses["token_bridge_terra.wasm"], + { + initiate_transfer: { + asset: { + amount: "10000", + info: { + native_token: { + denom: "uluna", + }, + }, + }, + recipient_chain: 2, + recipient: Buffer.from( + "0000000000000000000000000000000000000000000000000000000000000000", + "hex" + ).toString("base64"), + fee: "0", + nonce: 1, + }, + }, + {} // no fee? + // { uluna: 10050 } // fee + tax + ), + ], + memo: "", + fee: new Fee(500000, { uluna: 20_000_000 }), + }) + .then((tx) => broadcastAndWait(terra, tx)) + .then((rs) => console.log(rs)); + +/* test upgrade */ + +await wallet + .createAndSignTx({ + msgs: [ + new MsgUpdateContractAdmin( + wallet.key.accAddress, + addresses["token_bridge_terra.wasm"], + addresses["token_bridge_terra.wasm"] + ), + ], + memo: "", + fee: new Fee(200000, { uluna: 10_000_000 }), + }) + .then((tx) => broadcastAndWait(terra, tx)) + .then((rs) => console.log(rs)); + +const UPGRADE_VAA_6097_FROM_ETH = + "AQAAAAMNA4M1EZeonAE22/WmeXcWp1kJci8XZj/MRr9K019QfB/zXsrozO28hSPeq4wGvT2GZOvf7djGlYhAIXYQOCx7IUMABBrS/U8YwjT/jhAkTjsuGH1ig5VVIPMjCi2QDxD6Wr5oGOoBBXWAK3AUxMP/nuawQ1/dYKZjJ1EE9ibbGP3dNxABBVIMwhY0er6LQzSeTdvBtyLpLM8utXrdopTxE9ZzA5COeMGqzdn6XPmyARHHibeeQRDNcGxS6lV1CJv1Yz2/BEQBBlhVtjbvTto+YW/oE0tlwcAMF7cvoNNgaLGLQtHwr/m7dmS/1IgwyU2xlEa1GbGNKWHfFDpgQvdPpY753hDNjf8ACAluQ2xk+e2IbO0KBexrIjjF+LR9Zu05ofVeyBytRGC2NQnpb33jkFNdeirY7zhf6KJ/YfkkgO4wTDJ29Hz65XoACTvtROqwmVpmmehMW5GP0UitXzvb8wGuuA9H9WemocVSbIPFJvvsW5UhWFA2ivQUgeSpFVWzA4AsH5Fd2InYjtsACkMb0wH0gf6u6K27OoriGhYKPGb9kTd7PmsOnLRqQ/0Rc1fjqZ0iQi73qMAhWT+Kl1ZxIb8v8DPuRbDrkrNsFCwBDLt6ukezyOE6aP/H+RBJIstAGDo0kS3i3oRDOhhVOplKIs1l1RewUZTP4xVY5uekFdWwhh7Yg8/W46qLAdNj6hcADbOUgdrTYVn7+dqEWtrWhZjhfV70Y5Ih56ZVytpx2FczWF/fhtXr4B0F/RRohFZrGAZBfIijgEZj2TUByQaBjOcADqtjoqjyFady3nvn8WFdeu2xcHU+qLwMbGriJQNfzCn/Yjg/dDwdQ8e5R5vfU1cZXXwokS/BnM1z4WteOuJj2U8AEIoiz7KZb+IGtF9h0SMAzLfWEJ0o9uJPZU8FkyXb1vZRV/NqWjvaaiNidd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AAAAAAAAHIAAAAAAAAAAAAAAAAAAAAAAAAAAAAVG9rZW5CcmlkZ2UCAAMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf0A=="; + +await wallet + .createAndSignTx({ + msgs: [ + new MsgExecuteContract( + wallet.key.accAddress, + addresses["token_bridge_terra.wasm"], + { + submit_vaa: { + data: UPGRADE_VAA_8144_FROM_AVAX, + }, + } + ), + ], + memo: "", + fee: new Fee(1000000, { uluna: 50_000_000 }), + }) + .then((tx) => broadcastAndWait(terra, tx)) + .then((rs) => console.log(rs)); + +await wallet + .createAndSignTx({ + msgs: [ + new MsgExecuteContract( + wallet.key.accAddress, + addresses["token_bridge_terra.wasm"], + { + submit_vaa: { + data: UPGRADE_VAA_8144_FROM_AVAX_2, + }, + } + ), + ], + memo: "", + fee: new Fee(1000000, { uluna: 50_000_000 }), + }) + .then((tx) => broadcastAndWait(terra, tx)) + .then((rs) => console.log(rs));