disintar / toncli

TON Command Line Interface - easy smart contract manipulation
https://disintar.io/
Apache License 2.0
158 stars 35 forks source link

Fix gas limit comment #85

Closed Trinketer22 closed 1 year ago

Trinketer22 commented 1 year ago

This is actually gas_max and not gas_limit. Try

 (int, int) get_gl() asm "GASLIMITSTEMP";
int __test_gl() {
      set_gas_limit(2000000000);
      (int gl, _) = get_gl();
      return gl;
}

Will return 10^9 due to:https://github.com/ton-blockchain/ton/blob/master/crypto/vm/vm.cpp#L418 This is important to know for accept_message related testing, because this value would never increase. You have to set to lower gl inside the test case, and then compare to 10^9.