Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make it easier to understand when a contract execution fails with an exit code #128

Open
anton-trunov opened this issue Jun 28, 2024 · 0 comments

Comments

@anton-trunov
Copy link
Collaborator

The common case here is 'out-of-gas`. And the following evidence of this is not really user-friendly:

 FAIL  tests/InitDump.spec.ts
  InitDump
    ✕ should deploy (203 ms)

  ● InitDump › should deploy

    Expected [
      {
        lt: 2000000n,
        now: 1719558054,
        outMessagesCount: 1,
        oldStatus: 'active',
        endStatus: 'active',
        totalFees: 8833170n,
        from: undefined,
        to: EQBGhqLAZseEqRXz4ByFPTGV7SVMlI4hrbs-Sps_Xzx01x8G,
        on: EQBGhqLAZseEqRXz4ByFPTGV7SVMlI4hrbs-Sps_Xzx01x8G,
        value: undefined,
        body: x{392EB5CB4FB9D5E366AEE910D958E616BCB343EDC93FF0E0645D841BE76AFBCCC_}
         x{D001}
          x{620013A63C7241049E27B1B60D7EFBF2F4C8FDD33E541615CB4D232B1A6101C6BD15A017D78400000000000000000000000000023251AA62D80000000000000002_}
           x{FF00F4A413F4BCF2C80B}
            x{62_}
             x{D001D0D3030171B0A301FA400120D74981010BBAF2E08820D70B0A208104FFBAF2D0898309BAF2E088545053036F04F86102F862DB3C59DB3CF2E08230C8F84301CC7F01CA00C9ED54}
              x{ED44D0D401F863D20030916DE0F828D70B0A8309BAF2E089DB3C}
               x{8F576D8B82D2D2D2D696E697488D0A56D111509551D748119A5B194818DBDB9D1C9858DD1CCBDA5B9A5D17D91D5B5C0B9D1858DD0E8D4E8E60FE1430FE143020ED44ED45ED478AED67ED65ED64717FED118AED41EDF101F2FFDB00}
                x{318BE4552524F522D2D2D2D2D696E697488D0AD6D111509551D748119A5B194818DBDB9D1C9858DD1CCBDA5B9A5D17D91D5B5C0B9D1858DD0E8C4C4E8C4CE0FE1430FE1430DB3C8D0AD6D111509551D748119A5B194818DBDB9D1C9858DD1CCBDA5B9A5D17D91D5B5C0B9D1858DD0E8C4C8E8C4CE0FE1430FE1430}
                 x{C821C10098802D01CB0701A301DE218238327CB2734119D3B7A9AA1DB98E207020718E14047AA90CA63025A812A004AA0702A421C0004530E63033AA02CF018E2B6F00708E11237AA908126F8C01A4037AA90420C00014E63322A5039C53026F81A63058CB0702A559E43031E2C9D0}
                x{8D050B4B4B4B5A5B9A5D101B5E5059191C995CDCCB4C208D0A96D111509551D748119A5B194818DBDB9D1C9858DD1CCBDA5B9A5D17D91D5B5C0B9D1858DD0E8DCE8C4CE0FE1430FE1430F8288D0A96D111509551D748119A5B194818DBDB9D1C9858DD1CCBDA5B9A5D17D91D5B5C0B9D1858DD0E8E0E8C4CE0DB3C8989FE14}
                 x{01DB3C01FE1430FE1430}
                  x{FA44C88B1118CF16028307A0A9380758CB07CBFFC9D020DB3CC858CF1601CF16C9D0DB3C}
                   x{C801CF168B200008CF16C9D0709421C701B38E2A01D30783069320C2008E1B03AA005323B091A4DE03AB0023840FBC9903840FB0811021B203DEE8303101E8318307A90C01C8CB07CB07C9D0}
                   x{8D10105090D1115191D2125292D3135393D4145494D5155595D61656985898D9195999DA1A5A9ADB1B5B9BDC1C5C9CDD1D5D9DDE1E5E8C0C4C8CCD0D4D8DCE0E4B57E0C89522D749C2178AE86C21C9D0}
                    x{02D307D307D30703AA0F02AA0712B101B120AB11803FB0AA02523078D72414CF1623AB0B803FB0AA02523078D724CF1623AB05803FB0AA02523078D724CF1603803FB0AA02522078D72413CF16}
                 x{2D2D2D2D696E6974406D79416464726573732D31}
                 x{5B44454255475D2046696C6520636F6E7472616374732F696E69745F64756D702E746163743A393A3133}
                 x{30FE1430}
              x{0192307FE07021D749C21F953020D70B1FDE8210946A98B6BA8EA7D31F018210946A98B6BAF2E081D33F0131C8018210AFF90F5758CB1FCB3FC9F84201706DDB3C7FE03070}
               x{6D6D226EB3995B206EF2D0806F22019132E2102470030480425023DB3C}
                x{C87101CA01500701CA007001CA02500520D74981010BBAF2E08820D70B0A208104FFBAF2D0898309BAF2E088CF165003FA027001CA68236EB3917F93246EB3E2973333017001CA00E30D216EB39C7F01CA0001206EF2D08001CC95317001CA00E2C901FB00}
                 x{7F01CA00C87001CA007001CA00246EB39D7F01CA0004206EF2D0805004CC9634037001CA00E2246EB39D7F01CA0004206EF2D0805004CC9634037001CA00E27001CA00027F01CA0002C958CC}
             x{5}
              x{BBBD182705CEC3D5D2CAE7B1E84EC39D64A851B6682709DD6352D2B647CB322D3AF2DFDF1623982702055C01B80676394CE583AAE4725B2C382701BD49DEF954596F1C753D3DE0559C32682709D974E5AB34ECB733A0E966D9466E8A4}
              x{4}
               x{B0AFBB51343480006_}
               x{B26EE3435697066733A2F2F516D657846424861324B5A31594343684D79434A556A7563705862755539484C574564627638626B61704861707A82_}
           x{4_}
            x{C_}
             x{A0728B_}
              x{FF00F4A413F4BCF2C80B}
               x{62_}
                x{D001D0D3030171B0A301FA400120D74981010BBAF2E08820D70B0A208104FFBAF2D0898309BAF2E088545053036F04F86102F862DB3C59DB3CF2E08230C8F84301CC7F01CA00C9ED54}
                 x{ED44D0D401F863D20030916DE0F828D70B0A8309BAF2E089DB3C}
                  x{8F576D8B82D2D2D2D696E697488D0A56D111509551D748119A5B194818DBDB9D1C9858DD1CCBDA5B9A5D17D91D5B5C0B9D1858DD0E8D4E8E60FE1430FE143020ED44ED45ED478AED67ED65ED64717FED118AED41EDF101F2FFDB00}
                   x{318BE4552524F522D2D2D2D2D696E697488D0AD6D111509551D748119A5B194818DBDB9D1C9858DD1CCBDA5B9A5D17D91D5B5C0B9D1858DD0E8C4C4E8C4CE0FE1430FE1430DB3C8D0AD6D111509551D748119A5B194818DBDB9D1C9858DD1CCBDA5B9A5D17D91D5B5C0B9D1858DD0E8C4C8E8C4CE0FE1430FE1430}
                    x{C821C10098802D01CB0701A301DE218238327CB2734119D3B7A9AA1DB98E207020718E14047AA90CA63025A812A004AA0702A421C0004530E63033AA02CF018E2B6F00708E11237AA908126F8C01A4037AA90420C00014E63322A5039C53026F81A63058CB0702A559E43031E2C9D0}
                   x{8D050B4B4B4B5A5B9A5D101B5E5059191C995CDCCB4C208D0A96D111509551D748119A5B194818DBDB9D1C9858DD1CCBDA5B9A5D17D91D5B5C0B9D1858DD0E8DCE8C4CE0FE1430FE1430F8288D0A96D111509551D748119A5B194818DBDB9D1C9858DD1CCBDA5B9A5D17D91D5B5C0B9D1858DD0E8E0E8C4CE0DB3C8989FE14}
                    x{01DB3C01FE1430FE1430}
                     x{FA44C88B1118CF16028307A0A9380758CB07CBFFC9D020DB3CC858CF1601CF16C9D0DB3C}
                      x{C801CF168B200008CF16C9D0709421C701B38E2A01D30783069320C2008E1B03AA005323B091A4DE03AB0023840FBC9903840FB0811021B203DEE8303101E8318307A90C01C8CB07CB07C9D0}
                      x{8D10105090D1115191D2125292D3135393D4145494D5155595D61656985898D9195999DA1A5A9ADB1B5B9BDC1C5C9CDD1D5D9DDE1E5E8C0C4C8CCD0D4D8DCE0E4B57E0C89522D749C2178AE86C21C9D0}
                       x{02D307D307D30703AA0F02AA0712B101B120AB11803FB0AA02523078D72414CF1623AB0B803FB0AA02523078D724CF1623AB05803FB0AA02523078D724CF1603803FB0AA02522078D72413CF16}
                    x{2D2D2D2D696E6974406D79416464726573732D31}
                    x{5B44454255475D2046696C6520636F6E7472616374732F696E69745F64756D702E746163743A393A3133}
                    x{30FE1430}
                 x{0192307FE07021D749C21F953020D70B1FDE8210946A98B6BA8EA7D31F018210946A98B6BAF2E081D33F0131C8018210AFF90F5758CB1FCB3FC9F84201706DDB3C7FE03070}
                  x{6D6D226EB3995B206EF2D0806F22019132E2102470030480425023DB3C}
                   x{C87101CA01500701CA007001CA02500520D74981010BBAF2E08820D70B0A208104FFBAF2D0898309BAF2E088CF165003FA027001CA68236EB3917F93246EB3E2973333017001CA00E30D216EB39C7F01CA0001206EF2D08001CC95317001CA00E2C901FB00}
                    x{7F01CA00C87001CA007001CA00246EB39D7F01CA0004206EF2D0805004CC9634037001CA00E2246EB39D7F01CA0004206EF2D0805004CC9634037001CA00E27001CA00027F01CA0002C958CC}
                x{5}
                 x{BBBD182705CEC3D5D2CAE7B1E84EC39D64A851B6682709DD6352D2B647CB322D3AF2DFDF1623982702055C01B80676394CE583AAE4725B2C382701BD49DEF954596F1C753D3DE0559C32682709D974E5AB34ECB733A0E966D9466E8A4}
                 x{4}
                  x{B0AFBB51343480006_}
                  x{B26EE3435697066733A2F2F516D657846424861324B5A31594343684D79434A556A7563705862755539484C574564627638626B61704861707A82_},
        inMessageBounced: undefined,
        inMessageBounceable: undefined,
        op: 959362507,
        initData: undefined,
        initCode: undefined,
        deploy: false,
        aborted: false,
        destroyed: false,
        exitCode: 0,
        actionResultCode: 0,
        success: true
      },
      {
        lt: 3000000n,
        now: 1719558054,
        outMessagesCount: 0,
        oldStatus: 'uninitialized',
        endStatus: 'active',
        totalFees: 50000000n,
        from: EQBGhqLAZseEqRXz4ByFPTGV7SVMlI4hrbs-Sps_Xzx01x8G,
        to: EQAnTHjkggk8T2NsGv335emR-6Z8qCwrlppGVjTCA416K8R_,
        on: EQAnTHjkggk8T2NsGv335emR-6Z8qCwrlppGVjTCA416K8R_,
        value: 50000000n,
        body: x{946A98B60000000000000000},
        inMessageBounced: false,
        inMessageBounceable: true,
        op: 2490013878,
        initData: x{4_}
         x{C_}
          x{A0728B_}
           x{FF00F4A413F4BCF2C80B}
            x{62_}
             x{D001D0D3030171B0A301FA400120D74981010BBAF2E08820D70B0A208104FFBAF2D0898309BAF2E088545053036F04F86102F862DB3C59DB3CF2E08230C8F84301CC7F01CA00C9ED54}
              x{ED44D0D401F863D20030916DE0F828D70B0A8309BAF2E089DB3C}
               x{8F576D8B82D2D2D2D696E697488D0A56D111509551D748119A5B194818DBDB9D1C9858DD1CCBDA5B9A5D17D91D5B5C0B9D1858DD0E8D4E8E60FE1430FE143020ED44ED45ED478AED67ED65ED64717FED118AED41EDF101F2FFDB00}
                x{318BE4552524F522D2D2D2D2D696E697488D0AD6D111509551D748119A5B194818DBDB9D1C9858DD1CCBDA5B9A5D17D91D5B5C0B9D1858DD0E8C4C4E8C4CE0FE1430FE1430DB3C8D0AD6D111509551D748119A5B194818DBDB9D1C9858DD1CCBDA5B9A5D17D91D5B5C0B9D1858DD0E8C4C8E8C4CE0FE1430FE1430}
                 x{C821C10098802D01CB0701A301DE218238327CB2734119D3B7A9AA1DB98E207020718E14047AA90CA63025A812A004AA0702A421C0004530E63033AA02CF018E2B6F00708E11237AA908126F8C01A4037AA90420C00014E63322A5039C53026F81A63058CB0702A559E43031E2C9D0}
                x{8D050B4B4B4B5A5B9A5D101B5E5059191C995CDCCB4C208D0A96D111509551D748119A5B194818DBDB9D1C9858DD1CCBDA5B9A5D17D91D5B5C0B9D1858DD0E8DCE8C4CE0FE1430FE1430F8288D0A96D111509551D748119A5B194818DBDB9D1C9858DD1CCBDA5B9A5D17D91D5B5C0B9D1858DD0E8E0E8C4CE0DB3C8989FE14}
                 x{01DB3C01FE1430FE1430}
                  x{FA44C88B1118CF16028307A0A9380758CB07CBFFC9D020DB3CC858CF1601CF16C9D0DB3C}
                   x{C801CF168B200008CF16C9D0709421C701B38E2A01D30783069320C2008E1B03AA005323B091A4DE03AB0023840FBC9903840FB0811021B203DEE8303101E8318307A90C01C8CB07CB07C9D0}
                   x{8D10105090D1115191D2125292D3135393D4145494D5155595D61656985898D9195999DA1A5A9ADB1B5B9BDC1C5C9CDD1D5D9DDE1E5E8C0C4C8CCD0D4D8DCE0E4B57E0C89522D749C2178AE86C21C9D0}
                    x{02D307D307D30703AA0F02AA0712B101B120AB11803FB0AA02523078D72414CF1623AB0B803FB0AA02523078D724CF1623AB05803FB0AA02523078D724CF1603803FB0AA02522078D72413CF16}
                 x{2D2D2D2D696E6974406D79416464726573732D31}
                 x{5B44454255475D2046696C6520636F6E7472616374732F696E69745F64756D702E746163743A393A3133}
                 x{30FE1430}
              x{0192307FE07021D749C21F953020D70B1FDE8210946A98B6BA8EA7D31F018210946A98B6BAF2E081D33F0131C8018210AFF90F5758CB1FCB3FC9F84201706DDB3C7FE03070}
               x{6D6D226EB3995B206EF2D0806F22019132E2102470030480425023DB3C}
                x{C87101CA01500701CA007001CA02500520D74981010BBAF2E08820D70B0A208104FFBAF2D0898309BAF2E088CF165003FA027001CA68236EB3917F93246EB3E2973333017001CA00E30D216EB39C7F01CA0001206EF2D08001CC95317001CA00E2C901FB00}
                 x{7F01CA00C87001CA007001CA00246EB39D7F01CA0004206EF2D0805004CC9634037001CA00E2246EB39D7F01CA0004206EF2D0805004CC9634037001CA00E27001CA00027F01CA0002C958CC}
             x{5}
              x{BBBD182705CEC3D5D2CAE7B1E84EC39D64A851B6682709DD6352D2B647CB322D3AF2DFDF1623982702055C01B80676394CE583AAE4725B2C382701BD49DEF954596F1C753D3DE0559C32682709D974E5AB34ECB733A0E966D9466E8A4}
              x{4}
               x{B0AFBB51343480006_}
               x{B26EE3435697066733A2F2F516D657846424861324B5A31594343684D79434A556A7563705862755539484C574564627638626B61704861707A82_},
        initCode: x{FF00F4A413F4BCF2C80B}
         x{62_}
          x{D001D0D3030171B0A301FA400120D74981010BBAF2E08820D70B0A208104FFBAF2D0898309BAF2E088545053036F04F86102F862DB3C59DB3CF2E08230C8F84301CC7F01CA00C9ED54}
           x{ED44D0D401F863D20030916DE0F828D70B0A8309BAF2E089DB3C}
            x{8F576D8B82D2D2D2D696E697488D0A56D111509551D748119A5B194818DBDB9D1C9858DD1CCBDA5B9A5D17D91D5B5C0B9D1858DD0E8D4E8E60FE1430FE143020ED44ED45ED478AED67ED65ED64717FED118AED41EDF101F2FFDB00}
             x{318BE4552524F522D2D2D2D2D696E697488D0AD6D111509551D748119A5B194818DBDB9D1C9858DD1CCBDA5B9A5D17D91D5B5C0B9D1858DD0E8C4C4E8C4CE0FE1430FE1430DB3C8D0AD6D111509551D748119A5B194818DBDB9D1C9858DD1CCBDA5B9A5D17D91D5B5C0B9D1858DD0E8C4C8E8C4CE0FE1430FE1430}
              x{C821C10098802D01CB0701A301DE218238327CB2734119D3B7A9AA1DB98E207020718E14047AA90CA63025A812A004AA0702A421C0004530E63033AA02CF018E2B6F00708E11237AA908126F8C01A4037AA90420C00014E63322A5039C53026F81A63058CB0702A559E43031E2C9D0}
             x{8D050B4B4B4B5A5B9A5D101B5E5059191C995CDCCB4C208D0A96D111509551D748119A5B194818DBDB9D1C9858DD1CCBDA5B9A5D17D91D5B5C0B9D1858DD0E8DCE8C4CE0FE1430FE1430F8288D0A96D111509551D748119A5B194818DBDB9D1C9858DD1CCBDA5B9A5D17D91D5B5C0B9D1858DD0E8E0E8C4CE0DB3C8989FE14}
              x{01DB3C01FE1430FE1430}
               x{FA44C88B1118CF16028307A0A9380758CB07CBFFC9D020DB3CC858CF1601CF16C9D0DB3C}
                x{C801CF168B200008CF16C9D0709421C701B38E2A01D30783069320C2008E1B03AA005323B091A4DE03AB0023840FBC9903840FB0811021B203DEE8303101E8318307A90C01C8CB07CB07C9D0}
                x{8D10105090D1115191D2125292D3135393D4145494D5155595D61656985898D9195999DA1A5A9ADB1B5B9BDC1C5C9CDD1D5D9DDE1E5E8C0C4C8CCD0D4D8DCE0E4B57E0C89522D749C2178AE86C21C9D0}
                 x{02D307D307D30703AA0F02AA0712B101B120AB11803FB0AA02523078D72414CF1623AB0B803FB0AA02523078D724CF1623AB05803FB0AA02523078D724CF1603803FB0AA02522078D72413CF16}
              x{2D2D2D2D696E6974406D79416464726573732D31}
              x{5B44454255475D2046696C6520636F6E7472616374732F696E69745F64756D702E746163743A393A3133}
              x{30FE1430}
           x{0192307FE07021D749C21F953020D70B1FDE8210946A98B6BA8EA7D31F018210946A98B6BAF2E081D33F0131C8018210AFF90F5758CB1FCB3FC9F84201706DDB3C7FE03070}
            x{6D6D226EB3995B206EF2D0806F22019132E2102470030480425023DB3C}
             x{C87101CA01500701CA007001CA02500520D74981010BBAF2E08820D70B0A208104FFBAF2D0898309BAF2E088CF165003FA027001CA68236EB3917F93246EB3E2973333017001CA00E30D216EB39C7F01CA0001206EF2D08001CC95317001CA00E2C901FB00}
              x{7F01CA00C87001CA007001CA00246EB39D7F01CA0004206EF2D0805004CC9634037001CA00E2246EB39D7F01CA0004206EF2D0805004CC9634037001CA00E27001CA00027F01CA0002C958CC}
          x{5}
           x{BBBD182705CEC3D5D2CAE7B1E84EC39D64A851B6682709DD6352D2B647CB322D3AF2DFDF1623982702055C01B80676394CE583AAE4725B2C382701BD49DEF954596F1C753D3DE0559C32682709D974E5AB34ECB733A0E966D9466E8A4}
           x{4}
            x{B0AFBB51343480006_}
            x{B26EE3435697066733A2F2F516D657846424861324B5A31594343684D79434A556A7563705862755539484C574564627638626B61704861707A82_},
        deploy: true,
        aborted: true,
        destroyed: false,
        exitCode: -14,
        actionResultCode: undefined,
        success: false
      }
    ] to contain a transaction that matches pattern {
      from: EQBGhqLAZseEqRXz4ByFPTGV7SVMlI4hrbs-Sps_Xzx01x8G,
      to: EQAnTHjkggk8T2NsGv335emR-6Z8qCwrlppGVjTCA416K8R_,
      deploy: true,
      success: true
    }

      27 |         );
      28 |
    > 29 |         expect(deployResult.transactions).toHaveTransaction({
         |                                           ^
      30 |             from: deployer.address,
      31 |             to: initDump.address,
      32 |             deploy: true,

      at Object.<anonymous> (tests/InitDump.spec.ts:29:43)

Test Suites: 1 failed, 1 total
Tests:       1 failed, 1 total
Snapshots:   0 total
Time:        0.805 s, estimated 1 s
Ran all test suites.
Error: Command failed: npm test
    at genericNodeError (node:internal/errors:983:15)
    at wrappedFn (node:internal/errors:537:14)
    at checkExecSyncError (node:child_process:889:11)
    at execSync (node:child_process:961:15)
    at test (/Users/anton_1/ton/InitDump/node_modules/@ton/blueprint/dist/cli/test.js:6:34)
    at main (/Users/anton_1/ton/InitDump/node_modules/@ton/blueprint/dist/cli/cli.js:100:11)
    at processTicksAndRejections (node:internal/process/task_queues:95:5) {
  status: 1,
  signal: null,
  output: [ null, null, null ],
  pid: 74767,
  stdout: null,
  stderr: null
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant