Ver código fonte

ethereum/: use publishTime instead of attestationTime for queries (#196)

commit-id:b3c87e4e
Stanisław Drozd 3 anos atrás
pai
commit
7b9d5b1c22

+ 1 - 1
ethereum/contracts/pyth/Pyth.sol

@@ -201,7 +201,7 @@ contract Pyth is PythGetters, PythSetters, AbstractPyth {
         // Check that there is not a significant difference between this chain's time
         // and the attestation time. This is a last-resort safety net, and this check
         // will be iterated on in the future.
-        if (diff(block.timestamp, info.attestationTime) > VALID_TIME_PERIOD_SECS) {
+        if (diff(block.timestamp, info.publishTime) > VALID_TIME_PERIOD_SECS) {
             info.priceFeed.status = PythStructs.PriceStatus.UNKNOWN;
         }
 

Diferenças do arquivo suprimidas por serem muito extensas
+ 5 - 4
ethereum/test/pyth.js


+ 1 - 1
third_party/pyth/p2w-sdk/rust/src/lib.rs

@@ -490,7 +490,7 @@ mod tests {
             num_publishers:     123212u32,
             max_num_publishers: 321232u32,
             attestation_time:   (0xdeadbeeffadedeedu64) as i64,
-            publish_time:       0xdeadbeefi64,
+            publish_time:       0xdadebeefi64,
             prev_publish_time:  0xdeadbabei64,
             prev_price:         0xdeadfacebeefi64,
             prev_conf:          0xbadbadbeefu64, // I could do this all day -SD

Alguns arquivos não foram mostrados porque muitos arquivos mudaram nesse diff