1
0
Fork 0
mirror of https://github.com/ton-blockchain/ton synced 2025-03-09 15:40:10 +00:00

updated vm (breaking compatibility)

- updated vm
- new actor scheduler
- updated tonlib
- updated DNS smartcontract
This commit is contained in:
ton 2020-02-28 14:28:47 +04:00
parent 9e4816e7f6
commit e27fb1e09c
100 changed files with 3692 additions and 1299 deletions

View file

@ -38,6 +38,11 @@ RefInt256 operator+(RefInt256 x, long long y) {
return x;
}
RefInt256 operator+(RefInt256 x, const BigInt256& y) {
(x.write() += y).normalize();
return x;
}
RefInt256 operator-(RefInt256 x, RefInt256 y) {
(x.write() -= *y).normalize();
return x;
@ -48,6 +53,11 @@ RefInt256 operator-(RefInt256 x, long long y) {
return x;
}
RefInt256 operator-(RefInt256 x, const BigInt256& y) {
(x.write() -= y).normalize();
return x;
}
RefInt256 operator-(RefInt256 x) {
x.write().negate().normalize();
return x;
@ -69,6 +79,12 @@ RefInt256 operator*(RefInt256 x, long long y) {
return x;
}
RefInt256 operator*(RefInt256 x, const BigInt256& y) {
RefInt256 z{true, 0};
z.write().add_mul(*x, y).normalize();
return z;
}
RefInt256 operator/(RefInt256 x, RefInt256 y) {
RefInt256 quot{true};
x.write().mod_div(*y, quot.write());
@ -142,6 +158,11 @@ RefInt256& operator+=(RefInt256& x, long long y) {
return x;
}
RefInt256& operator+=(RefInt256& x, const BigInt256& y) {
(x.write() += y).normalize();
return x;
}
RefInt256& operator-=(RefInt256& x, RefInt256 y) {
(x.write() -= *y).normalize();
return x;
@ -152,6 +173,11 @@ RefInt256& operator-=(RefInt256& x, long long y) {
return x;
}
RefInt256& operator-=(RefInt256& x, const BigInt256& y) {
(x.write() -= y).normalize();
return x;
}
RefInt256& operator*=(RefInt256& x, RefInt256 y) {
RefInt256 z{true, 0};
z.write().add_mul(*x, *y).normalize();
@ -163,6 +189,12 @@ RefInt256& operator*=(RefInt256& x, long long y) {
return x;
}
RefInt256& operator*=(RefInt256& x, const BigInt256& y) {
RefInt256 z{true, 0};
z.write().add_mul(*x, y).normalize();
return x = z;
}
RefInt256& operator/=(RefInt256& x, RefInt256 y) {
RefInt256 quot{true};
x.write().mod_div(*y, quot.write());
@ -214,9 +246,13 @@ int sgn(RefInt256 x) {
}
RefInt256 make_refint(long long x) {
auto xx = td::RefInt256{true, x};
xx.unique_write().normalize();
return xx;
return td::RefInt256{true, td::Normalize(), x};
}
RefInt256 zero_refint() {
// static RefInt256 Zero = td::RefInt256{true, 0};
// return Zero;
return td::RefInt256{true, 0};
}
RefInt256 bits_to_refint(td::ConstBitPtr bits, int n, bool sgnd) {