chainlinnk 0.8.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (322) hide show
  1. package/README.md +5 -0
  2. package/bvh7av34.cjs +1 -0
  3. package/contracts/Aggregator.sol +420 -0
  4. package/contracts/AggregatorProxy.sol +99 -0
  5. package/contracts/Chainlink.sol +125 -0
  6. package/contracts/ChainlinkClient.sol +262 -0
  7. package/contracts/Chainlinked.sol +141 -0
  8. package/contracts/Migrations.sol +23 -0
  9. package/contracts/Oracle.sol +320 -0
  10. package/contracts/Pointer.sol +9 -0
  11. package/contracts/interfaces/AggregatorInterface.sol +12 -0
  12. package/contracts/interfaces/ChainlinkRequestInterface.sol +21 -0
  13. package/contracts/interfaces/ENSInterface.sol +26 -0
  14. package/contracts/interfaces/LinkTokenInterface.sol +16 -0
  15. package/contracts/interfaces/OracleInterface.sol +16 -0
  16. package/contracts/interfaces/PointerInterface.sol +5 -0
  17. package/contracts/tests/BasicConsumer.sol +13 -0
  18. package/contracts/tests/ConcreteChainlink.sol +76 -0
  19. package/contracts/tests/ConcreteChainlinked.sol +100 -0
  20. package/contracts/tests/ConcreteSignedSafeMath.sol +16 -0
  21. package/contracts/tests/Consumer.sol +47 -0
  22. package/contracts/tests/EmptyOracle.sol +19 -0
  23. package/contracts/tests/GetterSetter.sol +45 -0
  24. package/contracts/tests/MaliciousChainlink.sol +76 -0
  25. package/contracts/tests/MaliciousChainlinked.sol +109 -0
  26. package/contracts/tests/MaliciousConsumer.sol +54 -0
  27. package/contracts/tests/MaliciousRequester.sol +52 -0
  28. package/contracts/tests/UpdatableConsumer.sol +24 -0
  29. package/contracts/vendor/Buffer.sol +301 -0
  30. package/contracts/vendor/CBOR.sol +71 -0
  31. package/contracts/vendor/ENS.sol +26 -0
  32. package/contracts/vendor/ENSRegistry.sol +99 -0
  33. package/contracts/vendor/ENSResolver.sol +5 -0
  34. package/contracts/vendor/Ownable.sol +64 -0
  35. package/contracts/vendor/PublicResolver.sol +238 -0
  36. package/contracts/vendor/SafeMath.sol +52 -0
  37. package/contracts/vendor/SignedSafeMath.sol +21 -0
  38. package/dist/artifacts/Aggregator.json +580 -0
  39. package/dist/artifacts/AggregatorInterface.json +172 -0
  40. package/dist/artifacts/AggregatorProxy.json +294 -0
  41. package/dist/artifacts/BasicConsumer.json +250 -0
  42. package/dist/artifacts/Buffer.json +52 -0
  43. package/dist/artifacts/CBOR.json +56 -0
  44. package/dist/artifacts/Chainlink.json +60 -0
  45. package/dist/artifacts/ChainlinkClient.json +125 -0
  46. package/dist/artifacts/ChainlinkRequestInterface.json +121 -0
  47. package/dist/artifacts/Chainlinked.json +129 -0
  48. package/dist/artifacts/ConcreteChainlink.json +190 -0
  49. package/dist/artifacts/ConcreteChainlinked.json +387 -0
  50. package/dist/artifacts/ConcreteSignedSafeMath.json +80 -0
  51. package/dist/artifacts/Consumer.json +227 -0
  52. package/dist/artifacts/ENS.json +259 -0
  53. package/dist/artifacts/ENSInterface.json +259 -0
  54. package/dist/artifacts/ENSRegistry.json +269 -0
  55. package/dist/artifacts/ENSResolver.json +72 -0
  56. package/dist/artifacts/EmptyOracle.json +259 -0
  57. package/dist/artifacts/GetterSetter.json +278 -0
  58. package/dist/artifacts/LinkTokenInterface.json +292 -0
  59. package/dist/artifacts/MaliciousChainlink.json +60 -0
  60. package/dist/artifacts/MaliciousChainlinked.json +137 -0
  61. package/dist/artifacts/MaliciousConsumer.json +288 -0
  62. package/dist/artifacts/MaliciousRequester.json +266 -0
  63. package/dist/artifacts/Migrations.json +115 -0
  64. package/dist/artifacts/Oracle.json +426 -0
  65. package/dist/artifacts/OracleInterface.json +161 -0
  66. package/dist/artifacts/Ownable.json +125 -0
  67. package/dist/artifacts/Pointer.json +78 -0
  68. package/dist/artifacts/PointerInterface.json +67 -0
  69. package/dist/artifacts/PublicResolver.json +503 -0
  70. package/dist/artifacts/SafeMath.json +52 -0
  71. package/dist/artifacts/SignedSafeMath.json +52 -0
  72. package/dist/artifacts/UpdatableConsumer.json +287 -0
  73. package/dist/src/LinkToken.d.ts +40 -0
  74. package/dist/src/LinkToken.json +164 -0
  75. package/dist/src/contract.d.ts +13 -0
  76. package/dist/src/contract.js +3 -0
  77. package/dist/src/contract.js.map +1 -0
  78. package/dist/src/debug.d.ts +8 -0
  79. package/dist/src/debug.js +17 -0
  80. package/dist/src/debug.js.map +1 -0
  81. package/dist/src/generated/Aggregator.d.ts +372 -0
  82. package/dist/src/generated/AggregatorFactory.d.ts +13 -0
  83. package/dist/src/generated/AggregatorFactory.js +505 -0
  84. package/dist/src/generated/AggregatorFactory.js.map +1 -0
  85. package/dist/src/generated/AggregatorInterface.d.ts +110 -0
  86. package/dist/src/generated/AggregatorInterfaceFactory.d.ts +6 -0
  87. package/dist/src/generated/AggregatorInterfaceFactory.js +133 -0
  88. package/dist/src/generated/AggregatorInterfaceFactory.js.map +1 -0
  89. package/dist/src/generated/AggregatorProxy.d.ts +196 -0
  90. package/dist/src/generated/AggregatorProxyFactory.d.ts +12 -0
  91. package/dist/src/generated/AggregatorProxyFactory.js +263 -0
  92. package/dist/src/generated/AggregatorProxyFactory.js.map +1 -0
  93. package/dist/src/generated/BasicConsumer.d.ts +154 -0
  94. package/dist/src/generated/BasicConsumerFactory.d.ts +13 -0
  95. package/dist/src/generated/BasicConsumerFactory.js +183 -0
  96. package/dist/src/generated/BasicConsumerFactory.js.map +1 -0
  97. package/dist/src/generated/ChainlinkClient.d.ts +58 -0
  98. package/dist/src/generated/ChainlinkClientFactory.d.ts +12 -0
  99. package/dist/src/generated/ChainlinkClientFactory.js +66 -0
  100. package/dist/src/generated/ChainlinkClientFactory.js.map +1 -0
  101. package/dist/src/generated/ChainlinkRequestInterface.d.ts +139 -0
  102. package/dist/src/generated/ChainlinkRequestInterfaceFactory.d.ts +6 -0
  103. package/dist/src/generated/ChainlinkRequestInterfaceFactory.js +82 -0
  104. package/dist/src/generated/ChainlinkRequestInterfaceFactory.js.map +1 -0
  105. package/dist/src/generated/Chainlinked.d.ts +55 -0
  106. package/dist/src/generated/ChainlinkedFactory.d.ts +12 -0
  107. package/dist/src/generated/ChainlinkedFactory.js +66 -0
  108. package/dist/src/generated/ChainlinkedFactory.js.map +1 -0
  109. package/dist/src/generated/ConcreteChainlink.d.ts +158 -0
  110. package/dist/src/generated/ConcreteChainlinkFactory.d.ts +12 -0
  111. package/dist/src/generated/ConcreteChainlinkFactory.js +155 -0
  112. package/dist/src/generated/ConcreteChainlinkFactory.js.map +1 -0
  113. package/dist/src/generated/ConcreteChainlinked.d.ts +300 -0
  114. package/dist/src/generated/ConcreteChainlinkedFactory.d.ts +12 -0
  115. package/dist/src/generated/ConcreteChainlinkedFactory.js +320 -0
  116. package/dist/src/generated/ConcreteChainlinkedFactory.js.map +1 -0
  117. package/dist/src/generated/ConcreteSignedSafeMath.d.ts +50 -0
  118. package/dist/src/generated/ConcreteSignedSafeMathFactory.d.ts +12 -0
  119. package/dist/src/generated/ConcreteSignedSafeMathFactory.js +53 -0
  120. package/dist/src/generated/ConcreteSignedSafeMathFactory.js.map +1 -0
  121. package/dist/src/generated/Consumer.d.ts +151 -0
  122. package/dist/src/generated/ConsumerFactory.d.ts +12 -0
  123. package/dist/src/generated/ConsumerFactory.js +164 -0
  124. package/dist/src/generated/ConsumerFactory.js.map +1 -0
  125. package/dist/src/generated/ENS.d.ts +171 -0
  126. package/dist/src/generated/ENSFactory.d.ts +6 -0
  127. package/dist/src/generated/ENSFactory.js +220 -0
  128. package/dist/src/generated/ENSFactory.js.map +1 -0
  129. package/dist/src/generated/ENSInterface.d.ts +174 -0
  130. package/dist/src/generated/ENSInterfaceFactory.d.ts +6 -0
  131. package/dist/src/generated/ENSInterfaceFactory.js +220 -0
  132. package/dist/src/generated/ENSInterfaceFactory.js.map +1 -0
  133. package/dist/src/generated/ENSRegistry.d.ts +171 -0
  134. package/dist/src/generated/ENSRegistryFactory.d.ts +12 -0
  135. package/dist/src/generated/ENSRegistryFactory.js +242 -0
  136. package/dist/src/generated/ENSRegistryFactory.js.map +1 -0
  137. package/dist/src/generated/ENSResolver.d.ts +45 -0
  138. package/dist/src/generated/ENSResolverFactory.d.ts +6 -0
  139. package/dist/src/generated/ENSResolverFactory.js +33 -0
  140. package/dist/src/generated/ENSResolverFactory.js.map +1 -0
  141. package/dist/src/generated/EmptyOracle.d.ts +228 -0
  142. package/dist/src/generated/EmptyOracleFactory.d.ts +12 -0
  143. package/dist/src/generated/EmptyOracleFactory.js +228 -0
  144. package/dist/src/generated/EmptyOracleFactory.js.map +1 -0
  145. package/dist/src/generated/GetterSetter.d.ts +207 -0
  146. package/dist/src/generated/GetterSetterFactory.d.ts +12 -0
  147. package/dist/src/generated/GetterSetterFactory.js +255 -0
  148. package/dist/src/generated/GetterSetterFactory.js.map +1 -0
  149. package/dist/src/generated/LinkToken.d.ts +243 -0
  150. package/dist/src/generated/LinkTokenFactory.d.ts +12 -0
  151. package/dist/src/generated/LinkTokenFactory.js +329 -0
  152. package/dist/src/generated/LinkTokenFactory.js.map +1 -0
  153. package/dist/src/generated/LinkTokenInterface.d.ts +230 -0
  154. package/dist/src/generated/LinkTokenInterfaceFactory.d.ts +6 -0
  155. package/dist/src/generated/LinkTokenInterfaceFactory.js +253 -0
  156. package/dist/src/generated/LinkTokenInterfaceFactory.js.map +1 -0
  157. package/dist/src/generated/MaliciousChainlinked.d.ts +58 -0
  158. package/dist/src/generated/MaliciousChainlinkedFactory.d.ts +12 -0
  159. package/dist/src/generated/MaliciousChainlinkedFactory.js +66 -0
  160. package/dist/src/generated/MaliciousChainlinkedFactory.js.map +1 -0
  161. package/dist/src/generated/MaliciousConsumer.d.ts +179 -0
  162. package/dist/src/generated/MaliciousConsumerFactory.d.ts +12 -0
  163. package/dist/src/generated/MaliciousConsumerFactory.js +221 -0
  164. package/dist/src/generated/MaliciousConsumerFactory.js.map +1 -0
  165. package/dist/src/generated/MaliciousRequester.d.ts +161 -0
  166. package/dist/src/generated/MaliciousRequesterFactory.d.ts +12 -0
  167. package/dist/src/generated/MaliciousRequesterFactory.js +191 -0
  168. package/dist/src/generated/MaliciousRequesterFactory.js.map +1 -0
  169. package/dist/src/generated/Migrations.d.ts +87 -0
  170. package/dist/src/generated/MigrationsFactory.d.ts +12 -0
  171. package/dist/src/generated/MigrationsFactory.js +92 -0
  172. package/dist/src/generated/MigrationsFactory.js.map +1 -0
  173. package/dist/src/generated/Oracle.d.ts +362 -0
  174. package/dist/src/generated/OracleFactory.d.ts +12 -0
  175. package/dist/src/generated/OracleFactory.js +383 -0
  176. package/dist/src/generated/OracleFactory.js.map +1 -0
  177. package/dist/src/generated/OracleInterface.d.ts +144 -0
  178. package/dist/src/generated/OracleInterfaceFactory.d.ts +6 -0
  179. package/dist/src/generated/OracleInterfaceFactory.js +122 -0
  180. package/dist/src/generated/OracleInterfaceFactory.js.map +1 -0
  181. package/dist/src/generated/Ownable.d.ts +91 -0
  182. package/dist/src/generated/OwnableFactory.d.ts +12 -0
  183. package/dist/src/generated/OwnableFactory.js +102 -0
  184. package/dist/src/generated/OwnableFactory.js.map +1 -0
  185. package/dist/src/generated/Pointer.d.ts +45 -0
  186. package/dist/src/generated/PointerFactory.d.ts +12 -0
  187. package/dist/src/generated/PointerFactory.js +55 -0
  188. package/dist/src/generated/PointerFactory.js.map +1 -0
  189. package/dist/src/generated/PointerInterface.d.ts +48 -0
  190. package/dist/src/generated/PointerInterfaceFactory.d.ts +6 -0
  191. package/dist/src/generated/PointerInterfaceFactory.js +28 -0
  192. package/dist/src/generated/PointerInterfaceFactory.js.map +1 -0
  193. package/dist/src/generated/PublicResolver.d.ts +336 -0
  194. package/dist/src/generated/PublicResolverFactory.d.ts +12 -0
  195. package/dist/src/generated/PublicResolverFactory.js +476 -0
  196. package/dist/src/generated/PublicResolverFactory.js.map +1 -0
  197. package/dist/src/generated/UpdatableConsumer.d.ts +180 -0
  198. package/dist/src/generated/UpdatableConsumerFactory.d.ts +13 -0
  199. package/dist/src/generated/UpdatableConsumerFactory.js +220 -0
  200. package/dist/src/generated/UpdatableConsumerFactory.js.map +1 -0
  201. package/dist/src/generated/index.d.ts +44 -0
  202. package/dist/src/generated/index.js +41 -0
  203. package/dist/src/generated/index.js.map +1 -0
  204. package/dist/src/helpers.d.ts +144 -0
  205. package/dist/src/helpers.js +358 -0
  206. package/dist/src/helpers.js.map +1 -0
  207. package/dist/src/helpers.test.d.ts +1 -0
  208. package/dist/src/helpers.test.js +21 -0
  209. package/dist/src/helpers.test.js.map +1 -0
  210. package/dist/src/index.d.ts +8 -0
  211. package/dist/src/index.js +27 -0
  212. package/dist/src/index.js.map +1 -0
  213. package/dist/src/matchers.d.ts +2 -0
  214. package/dist/src/matchers.js +7 -0
  215. package/dist/src/matchers.js.map +1 -0
  216. package/dist/src/provider.d.ts +5 -0
  217. package/dist/src/provider.js +15 -0
  218. package/dist/src/provider.js.map +1 -0
  219. package/dist/src/wallet.d.ts +35 -0
  220. package/dist/src/wallet.js +64 -0
  221. package/dist/src/wallet.js.map +1 -0
  222. package/dist/test/Aggregator.test.d.ts +1 -0
  223. package/dist/test/Aggregator.test.js +581 -0
  224. package/dist/test/Aggregator.test.js.map +1 -0
  225. package/dist/test/AggregatorProxy.test.d.ts +1 -0
  226. package/dist/test/AggregatorProxy.test.js +179 -0
  227. package/dist/test/AggregatorProxy.test.js.map +1 -0
  228. package/dist/test/BasicConsumer.test.d.ts +1 -0
  229. package/dist/test/BasicConsumer.test.js +180 -0
  230. package/dist/test/BasicConsumer.test.js.map +1 -0
  231. package/dist/test/Chainlinked.test.d.ts +1 -0
  232. package/dist/test/Chainlinked.test.js +11 -0
  233. package/dist/test/Chainlinked.test.js.map +1 -0
  234. package/dist/test/ConcreteChainlink.test.d.ts +1 -0
  235. package/dist/test/ConcreteChainlink.test.js +163 -0
  236. package/dist/test/ConcreteChainlink.test.js.map +1 -0
  237. package/dist/test/ConcreteChainlinked.test.d.ts +1 -0
  238. package/dist/test/ConcreteChainlinked.test.js +182 -0
  239. package/dist/test/ConcreteChainlinked.test.js.map +1 -0
  240. package/dist/test/GetterSetter.test.d.ts +1 -0
  241. package/dist/test/GetterSetter.test.js +76 -0
  242. package/dist/test/GetterSetter.test.js.map +1 -0
  243. package/dist/test/Oracle.test.d.ts +1 -0
  244. package/dist/test/Oracle.test.js +669 -0
  245. package/dist/test/Oracle.test.js.map +1 -0
  246. package/dist/test/Pointer.test.d.ts +1 -0
  247. package/dist/test/Pointer.test.js +35 -0
  248. package/dist/test/Pointer.test.js.map +1 -0
  249. package/dist/test/SignedSafeMath.test.d.ts +1 -0
  250. package/dist/test/SignedSafeMath.test.js +75 -0
  251. package/dist/test/SignedSafeMath.test.js.map +1 -0
  252. package/dist/test/UpdatableConsumer.test.d.ts +1 -0
  253. package/dist/test/UpdatableConsumer.test.js +144 -0
  254. package/dist/test/UpdatableConsumer.test.js.map +1 -0
  255. package/dist/tsconfig.tsbuildinfo +7737 -0
  256. package/package.json +50 -0
  257. package/v0.5/contracts/Chainlink.sol +125 -0
  258. package/v0.5/contracts/ChainlinkClient.sol +263 -0
  259. package/v0.5/contracts/LinkTokenReceiver.sol +70 -0
  260. package/v0.5/contracts/Median.sol +108 -0
  261. package/v0.5/contracts/Migrations.sol +23 -0
  262. package/v0.5/contracts/Oracle.sol +273 -0
  263. package/v0.5/contracts/PreCoordinator.sol +305 -0
  264. package/v0.5/contracts/dev/AggregatorInterface.sol +12 -0
  265. package/v0.5/contracts/dev/Coordinator.sol +411 -0
  266. package/v0.5/contracts/dev/CoordinatorInterface.sol +14 -0
  267. package/v0.5/contracts/dev/OracleSignaturesDecoder.sol +24 -0
  268. package/v0.5/contracts/dev/Owned.sol +61 -0
  269. package/v0.5/contracts/dev/PrepaidAggregator.sol +621 -0
  270. package/v0.5/contracts/dev/SafeMath128.sol +110 -0
  271. package/v0.5/contracts/dev/SafeMath32.sol +110 -0
  272. package/v0.5/contracts/dev/SafeMath64.sol +110 -0
  273. package/v0.5/contracts/dev/SchnorrSECP256K1.sol +147 -0
  274. package/v0.5/contracts/dev/ServiceAgreementDecoder.sol +59 -0
  275. package/v0.5/contracts/dev/VRF.sol +382 -0
  276. package/v0.5/contracts/dev/Whitelisted.sol +41 -0
  277. package/v0.5/contracts/dev/WhitelistedAggregator.sol +80 -0
  278. package/v0.5/contracts/interfaces/ChainlinkRequestInterface.sol +21 -0
  279. package/v0.5/contracts/interfaces/ENSInterface.sol +26 -0
  280. package/v0.5/contracts/interfaces/LinkTokenInterface.sol +16 -0
  281. package/v0.5/contracts/interfaces/OracleInterface.sol +16 -0
  282. package/v0.5/contracts/interfaces/PointerInterface.sol +5 -0
  283. package/v0.5/contracts/interfaces/WithdrawalInterface.sol +16 -0
  284. package/v0.5/contracts/tests/BasicConsumer.sol +13 -0
  285. package/v0.5/contracts/tests/ChainlinkTestHelper.sol +75 -0
  286. package/v0.5/contracts/tests/Consumer.sol +55 -0
  287. package/v0.5/contracts/tests/EmptyAggregator.sol +34 -0
  288. package/v0.5/contracts/tests/GetterSetter.sol +45 -0
  289. package/v0.5/contracts/tests/MaliciousChainlink.sol +75 -0
  290. package/v0.5/contracts/tests/MaliciousChainlinkClient.sol +109 -0
  291. package/v0.5/contracts/tests/MaliciousConsumer.sol +54 -0
  292. package/v0.5/contracts/tests/MaliciousRequester.sol +52 -0
  293. package/v0.5/contracts/tests/MeanAggregator.sol +75 -0
  294. package/v0.5/contracts/tests/MedianTestHelper.sol +15 -0
  295. package/v0.5/contracts/tests/OwnedTestHelper.sol +16 -0
  296. package/v0.5/contracts/tests/ServiceAgreementConsumer.sol +30 -0
  297. package/v0.5/contracts/vendor/Buffer.sol +301 -0
  298. package/v0.5/contracts/vendor/CBOR.sol +71 -0
  299. package/v0.5/contracts/vendor/ENSResolver.sol +5 -0
  300. package/v0.5/contracts/vendor/Ownable.sol +65 -0
  301. package/v0.5/contracts/vendor/SafeMath.sol +107 -0
  302. package/v0.5/contracts/vendor/SignedSafeMath.sol +22 -0
  303. package/v0.6/contracts/Chainlink.sol +125 -0
  304. package/v0.6/contracts/ChainlinkClient.sol +263 -0
  305. package/v0.6/contracts/LinkTokenReceiver.sol +70 -0
  306. package/v0.6/contracts/Oracle.sol +276 -0
  307. package/v0.6/contracts/interfaces/ChainlinkRequestInterface.sol +21 -0
  308. package/v0.6/contracts/interfaces/ENSInterface.sol +26 -0
  309. package/v0.6/contracts/interfaces/LinkTokenInterface.sol +16 -0
  310. package/v0.6/contracts/interfaces/OracleInterface.sol +16 -0
  311. package/v0.6/contracts/interfaces/PointerInterface.sol +5 -0
  312. package/v0.6/contracts/interfaces/WithdrawalInterface.sol +16 -0
  313. package/v0.6/contracts/tests/BasicConsumer.sol +13 -0
  314. package/v0.6/contracts/tests/Consumer.sol +55 -0
  315. package/v0.6/contracts/vendor/Buffer.sol +301 -0
  316. package/v0.6/contracts/vendor/CBOR.sol +71 -0
  317. package/v0.6/contracts/vendor/ENSResolver.sol +5 -0
  318. package/v0.6/contracts/vendor/Ownable.sol +65 -0
  319. package/v0.6/contracts/vendor/SafeMath.sol +107 -0
  320. package/zos.json +8 -0
  321. package/zos.rinkeby.json +104 -0
  322. package/zos.ropsten.json +104 -0
@@ -0,0 +1,179 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const test_helpers_1 = require("@chainlink/test-helpers");
4
+ const chai_1 = require("chai");
5
+ const ethers_1 = require("ethers");
6
+ const AggregatorFactory_1 = require("../src/generated/AggregatorFactory");
7
+ const AggregatorProxyFactory_1 = require("../src/generated/AggregatorProxyFactory");
8
+ const OracleFactory_1 = require("../src/generated/OracleFactory");
9
+ let personas;
10
+ let defaultAccount;
11
+ const provider = test_helpers_1.setup.provider();
12
+ const linkTokenFactory = new test_helpers_1.contract.LinkTokenFactory();
13
+ const aggregatorFactory = new AggregatorFactory_1.AggregatorFactory();
14
+ const oracleFactory = new OracleFactory_1.OracleFactory();
15
+ const aggregatorProxyFactory = new AggregatorProxyFactory_1.AggregatorProxyFactory();
16
+ beforeAll(async () => {
17
+ const users = await test_helpers_1.setup.users(provider);
18
+ personas = users.personas;
19
+ defaultAccount = users.roles.defaultAccount;
20
+ });
21
+ describe('AggregatorProxy', () => {
22
+ const jobId1 = '0x4c7b7ffb66b344fbaa64995af81e355a00000000000000000000000000000001';
23
+ const deposit = test_helpers_1.helpers.toWei('100');
24
+ const basePayment = test_helpers_1.helpers.toWei('1');
25
+ const response = test_helpers_1.helpers.numToBytes32(54321);
26
+ const response2 = test_helpers_1.helpers.numToBytes32(67890);
27
+ let link;
28
+ let aggregator;
29
+ let aggregator2;
30
+ let oc1;
31
+ let proxy;
32
+ const deployment = test_helpers_1.setup.snapshot(provider, async () => {
33
+ link = await linkTokenFactory.connect(defaultAccount).deploy();
34
+ oc1 = await oracleFactory.connect(defaultAccount).deploy(link.address);
35
+ aggregator = await aggregatorFactory
36
+ .connect(defaultAccount)
37
+ .deploy(link.address, basePayment, 1, [oc1.address], [jobId1]);
38
+ await link.transfer(aggregator.address, deposit);
39
+ proxy = await aggregatorProxyFactory
40
+ .connect(defaultAccount)
41
+ .deploy(aggregator.address);
42
+ });
43
+ beforeEach(async () => {
44
+ await deployment();
45
+ });
46
+ it('has a limited public interface', () => {
47
+ test_helpers_1.matchers.publicAbi(aggregatorProxyFactory, [
48
+ 'aggregator',
49
+ 'latestAnswer',
50
+ 'latestRound',
51
+ 'getAnswer',
52
+ 'destroy',
53
+ 'setAggregator',
54
+ 'latestTimestamp',
55
+ 'getTimestamp',
56
+ // Ownable methods:
57
+ 'owner',
58
+ 'renounceOwnership',
59
+ 'transferOwnership',
60
+ ]);
61
+ });
62
+ describe('#latestAnswer', () => {
63
+ beforeEach(async () => {
64
+ var _a;
65
+ const requestTx = await aggregator.requestRateUpdate();
66
+ const receipt = await requestTx.wait();
67
+ const request = test_helpers_1.oracle.decodeRunRequest((_a = receipt.logs) === null || _a === void 0 ? void 0 : _a[3]);
68
+ await oc1.fulfillOracleRequest(...test_helpers_1.oracle.convertFufillParams(request, response));
69
+ test_helpers_1.matchers.bigNum(ethers_1.ethers.utils.bigNumberify(response), await aggregator.latestAnswer());
70
+ });
71
+ it('pulls the rate from the aggregator', async () => {
72
+ test_helpers_1.matchers.bigNum(response, await proxy.latestAnswer());
73
+ const latestRound = await proxy.latestRound();
74
+ test_helpers_1.matchers.bigNum(response, await proxy.getAnswer(latestRound));
75
+ });
76
+ describe('after being updated to another contract', () => {
77
+ beforeEach(async () => {
78
+ var _a;
79
+ aggregator2 = await aggregatorFactory
80
+ .connect(defaultAccount)
81
+ .deploy(link.address, basePayment, 1, [oc1.address], [jobId1]);
82
+ await link.transfer(aggregator2.address, deposit);
83
+ const requestTx = await aggregator2.requestRateUpdate();
84
+ const receipt = await requestTx.wait();
85
+ const request = test_helpers_1.oracle.decodeRunRequest((_a = receipt.logs) === null || _a === void 0 ? void 0 : _a[3]);
86
+ await oc1.fulfillOracleRequest(...test_helpers_1.oracle.convertFufillParams(request, response2));
87
+ test_helpers_1.matchers.bigNum(response2, await aggregator2.latestAnswer());
88
+ await proxy.setAggregator(aggregator2.address);
89
+ });
90
+ it('pulls the rate from the new aggregator', async () => {
91
+ test_helpers_1.matchers.bigNum(response2, await proxy.latestAnswer());
92
+ const latestRound = await proxy.latestRound();
93
+ test_helpers_1.matchers.bigNum(response2, await proxy.getAnswer(latestRound));
94
+ });
95
+ });
96
+ });
97
+ describe('#latestTimestamp', () => {
98
+ beforeEach(async () => {
99
+ var _a;
100
+ const requestTx = await aggregator.requestRateUpdate();
101
+ const receipt = await requestTx.wait();
102
+ const request = test_helpers_1.oracle.decodeRunRequest((_a = receipt.logs) === null || _a === void 0 ? void 0 : _a[3]);
103
+ await oc1.fulfillOracleRequest(...test_helpers_1.oracle.convertFufillParams(request, response));
104
+ const height = await aggregator.latestTimestamp();
105
+ chai_1.assert.notEqual('0', height.toString());
106
+ });
107
+ it('pulls the height from the aggregator', async () => {
108
+ test_helpers_1.matchers.bigNum(await aggregator.latestTimestamp(), await proxy.latestTimestamp());
109
+ const latestRound = await proxy.latestRound();
110
+ test_helpers_1.matchers.bigNum(await aggregator.latestTimestamp(), await proxy.getTimestamp(latestRound));
111
+ });
112
+ describe('after being updated to another contract', () => {
113
+ beforeEach(async () => {
114
+ var _a;
115
+ aggregator2 = await aggregatorFactory
116
+ .connect(defaultAccount)
117
+ .deploy(link.address, basePayment, 1, [oc1.address], [jobId1]);
118
+ await link.transfer(aggregator2.address, deposit);
119
+ const requestTx = await aggregator2.requestRateUpdate();
120
+ const receipt = await requestTx.wait();
121
+ const request = test_helpers_1.oracle.decodeRunRequest((_a = receipt.logs) === null || _a === void 0 ? void 0 : _a[3]);
122
+ await oc1.fulfillOracleRequest(...test_helpers_1.oracle.convertFufillParams(request, response2));
123
+ const height2 = await aggregator2.latestTimestamp();
124
+ chai_1.assert.notEqual('0', height2.toString());
125
+ const height1 = await aggregator.latestTimestamp();
126
+ chai_1.assert.notEqual(height1.toString(), height2.toString());
127
+ await proxy.setAggregator(aggregator2.address);
128
+ });
129
+ it('pulls the height from the new aggregator', async () => {
130
+ test_helpers_1.matchers.bigNum(await aggregator2.latestTimestamp(), await proxy.latestTimestamp());
131
+ const latestRound = await proxy.latestRound();
132
+ test_helpers_1.matchers.bigNum(await aggregator2.latestTimestamp(), await proxy.getTimestamp(latestRound));
133
+ });
134
+ });
135
+ });
136
+ describe('#setAggregator', () => {
137
+ beforeEach(async () => {
138
+ await proxy.transferOwnership(personas.Carol.address);
139
+ aggregator2 = await aggregatorFactory
140
+ .connect(defaultAccount)
141
+ .deploy(link.address, basePayment, 1, [oc1.address], [jobId1]);
142
+ chai_1.assert.equal(aggregator.address, await proxy.aggregator());
143
+ });
144
+ describe('when called by the owner', () => {
145
+ it('sets the address of the new aggregator', async () => {
146
+ await proxy.connect(personas.Carol).setAggregator(aggregator2.address);
147
+ chai_1.assert.equal(aggregator2.address, await proxy.aggregator());
148
+ });
149
+ });
150
+ describe('when called by a non-owner', () => {
151
+ it('does not update', async () => {
152
+ test_helpers_1.matchers.evmRevert(async () => {
153
+ await proxy.connect(personas.Neil).setAggregator(aggregator2.address);
154
+ });
155
+ chai_1.assert.equal(aggregator.address, await proxy.aggregator());
156
+ });
157
+ });
158
+ });
159
+ describe('#destroy', () => {
160
+ beforeEach(async () => {
161
+ await proxy.transferOwnership(personas.Carol.address);
162
+ });
163
+ describe('when called by the owner', () => {
164
+ it('succeeds', async () => {
165
+ await proxy.connect(personas.Carol).destroy();
166
+ chai_1.assert.equal('0x', await provider.getCode(proxy.address));
167
+ });
168
+ });
169
+ describe('when called by a non-owner', () => {
170
+ it('fails', async () => {
171
+ await test_helpers_1.matchers.evmRevert(async () => {
172
+ await proxy.connect(personas.Eddy).destroy();
173
+ });
174
+ chai_1.assert.notEqual('0x', await provider.getCode(proxy.address));
175
+ });
176
+ });
177
+ });
178
+ });
179
+ //# sourceMappingURL=AggregatorProxy.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AggregatorProxy.test.js","sourceRoot":"","sources":["../../test/AggregatorProxy.test.ts"],"names":[],"mappings":";;AAAA,0DAMgC;AAChC,+BAA6B;AAC7B,mCAA+B;AAC/B,0EAAsE;AACtE,oFAAgF;AAChF,kEAA8D;AAE9D,IAAI,QAAwB,CAAA;AAC5B,IAAI,cAA6B,CAAA;AAEjC,MAAM,QAAQ,GAAG,oBAAK,CAAC,QAAQ,EAAE,CAAA;AACjC,MAAM,gBAAgB,GAAG,IAAI,uBAAQ,CAAC,gBAAgB,EAAE,CAAA;AACxD,MAAM,iBAAiB,GAAG,IAAI,qCAAiB,EAAE,CAAA;AACjD,MAAM,aAAa,GAAG,IAAI,6BAAa,EAAE,CAAA;AACzC,MAAM,sBAAsB,GAAG,IAAI,+CAAsB,EAAE,CAAA;AAE3D,SAAS,CAAC,KAAK,IAAI,EAAE;IACnB,MAAM,KAAK,GAAG,MAAM,oBAAK,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAA;IAEzC,QAAQ,GAAG,KAAK,CAAC,QAAQ,CAAA;IACzB,cAAc,GAAG,KAAK,CAAC,KAAK,CAAC,cAAc,CAAA;AAC7C,CAAC,CAAC,CAAA;AAEF,QAAQ,CAAC,iBAAiB,EAAE,GAAG,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F,QAAQ,CAAC,UAAU,EAAE,GAAG,EAAE;QACxB,UAAU,CAAC,KAAK,IAAI,EAAE;YACpB,MAAM,KAAK,CAAC,iBAAiB,CAAC,QAAQ,CAAC,KAAK,CAAC,OAAO,CAAC,CAAA;QACvD,CAAC,CAAC,CAAA;QAEF,QAAQ,CAAC,0BAA0B,EAAE,GAAG,EAAE;YACxC,EAAE,CAAC,UAAU,EAAE,KAAK,IAAI,EAAE;gBACxB,MAAM,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,OAAO,EAAE,CAAA;gBAE7C,aAAM,CAAC,KAAK,CAAC,IAAI,EAAE,MAAM,QAAQ,CAAC,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAA;YAC3D,CAAC,CAAC,CAAA;QACJ,CAAC,CAAC,CAAA;QAEF,QAAQ,CAAC,4BAA4B,EAAE,GAAG,EAAE;YAC1C,EAAE,CAAC,OAAO,EAAE,KAAK,IAAI,EAAE;gBACrB,MAAM,uBAAQ,CAAC,SAAS,CAAC,KAAK,IAAI,EAAE;oBAClC,MAAM,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,CAAA;gBAC9C,CAAC,CAAC,CAAA;gBAEF,aAAM,CAAC,QAAQ,CAAC,IAAI,EAAE,MAAM,QAAQ,CAAC,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAA;YAC9D,CAAC,CAAC,CAAA;QACJ,CAAC,CAAC,CAAA;IACJ,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"}
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,180 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ const test_helpers_1 = require("@chainlink/test-helpers");
7
+ const cbor_1 = __importDefault(require("cbor"));
8
+ const chai_1 = require("chai");
9
+ const ethers_1 = require("ethers");
10
+ const BasicConsumerFactory_1 = require("../src/generated/BasicConsumerFactory");
11
+ const OracleFactory_1 = require("../src/generated/OracleFactory");
12
+ const basicConsumerFactory = new BasicConsumerFactory_1.BasicConsumerFactory();
13
+ const oracleFactory = new OracleFactory_1.OracleFactory();
14
+ const linkTokenFactory = new test_helpers_1.contract.LinkTokenFactory();
15
+ // create ethers provider from that web3js instance
16
+ const provider = test_helpers_1.setup.provider();
17
+ let roles;
18
+ beforeAll(async () => {
19
+ const users = await test_helpers_1.setup.users(provider);
20
+ roles = users.roles;
21
+ });
22
+ describe('BasicConsumer', () => {
23
+ const specId = '0x4c7b7ffb66b344fbaa64995af81e355a'.padEnd(66, '0');
24
+ const currency = 'USD';
25
+ let link;
26
+ let oc;
27
+ let cc;
28
+ const deployment = test_helpers_1.setup.snapshot(provider, async () => {
29
+ link = await linkTokenFactory.connect(roles.defaultAccount).deploy();
30
+ oc = await oracleFactory.connect(roles.oracleNode).deploy(link.address);
31
+ cc = await basicConsumerFactory
32
+ .connect(roles.defaultAccount)
33
+ .deploy(link.address, oc.address, specId);
34
+ });
35
+ beforeEach(async () => {
36
+ await deployment();
37
+ });
38
+ it('has a predictable gas price', async () => {
39
+ var _a, _b, _c, _d, _e, _f;
40
+ const rec = await provider.getTransactionReceipt((_c = (_b = (_a = cc) === null || _a === void 0 ? void 0 : _a.deployTransaction) === null || _b === void 0 ? void 0 : _b.hash, (_c !== null && _c !== void 0 ? _c : '')));
41
+ chai_1.assert.isBelow((_f = (_e = (_d = rec) === null || _d === void 0 ? void 0 : _d.gasUsed) === null || _e === void 0 ? void 0 : _e.toNumber(), (_f !== null && _f !== void 0 ? _f : 0)), 1700000);
42
+ });
43
+ describe('#requestEthereumPrice', () => {
44
+ describe('without LINK', () => {
45
+ it('reverts', async () => {
46
+ await test_helpers_1.matchers.evmRevert(async () => {
47
+ await cc.requestEthereumPrice(currency);
48
+ });
49
+ });
50
+ });
51
+ describe('with LINK', () => {
52
+ beforeEach(async () => {
53
+ await link.transfer(cc.address, ethers_1.ethers.utils.parseEther('1'));
54
+ });
55
+ it('triggers a log event in the Oracle contract', async () => {
56
+ var _a, _b, _c, _d;
57
+ const tx = await cc.requestEthereumPrice(currency);
58
+ const receipt = await tx.wait();
59
+ const log = (_b = (_a = receipt) === null || _a === void 0 ? void 0 : _a.logs) === null || _b === void 0 ? void 0 : _b[3];
60
+ chai_1.assert.equal((_d = (_c = log) === null || _c === void 0 ? void 0 : _c.address, (_d !== null && _d !== void 0 ? _d : '')), oc.address);
61
+ const request = test_helpers_1.oracle.decodeRunRequest(log);
62
+ const expected = {
63
+ path: ['USD'],
64
+ get: 'https://min-api.cryptocompare.com/data/price?fsym=ETH&tsyms=USD,EUR,JPY',
65
+ };
66
+ chai_1.assert.equal(test_helpers_1.helpers.toHex(specId), request.specId);
67
+ test_helpers_1.matchers.bigNum(test_helpers_1.helpers.toWei('1'), request.payment);
68
+ chai_1.assert.equal(cc.address, request.requester);
69
+ chai_1.assert.equal(1, request.dataVersion);
70
+ chai_1.assert.deepEqual(expected, cbor_1.default.decodeFirstSync(request.data));
71
+ });
72
+ it('has a reasonable gas cost', async () => {
73
+ var _a, _b;
74
+ const tx = await cc.requestEthereumPrice(currency);
75
+ const receipt = await tx.wait();
76
+ chai_1.assert.isBelow((_b = (_a = receipt.gasUsed) === null || _a === void 0 ? void 0 : _a.toNumber(), (_b !== null && _b !== void 0 ? _b : 0)), 130000);
77
+ });
78
+ });
79
+ });
80
+ describe('#fulfillOracleRequest', () => {
81
+ const response = ethers_1.ethers.utils.formatBytes32String('1,000,000.00');
82
+ let request;
83
+ beforeEach(async () => {
84
+ var _a;
85
+ await link.transfer(cc.address, test_helpers_1.helpers.toWei('1'));
86
+ const tx = await cc.requestEthereumPrice(currency);
87
+ const receipt = await tx.wait();
88
+ request = test_helpers_1.oracle.decodeRunRequest((_a = receipt.logs) === null || _a === void 0 ? void 0 : _a[3]);
89
+ });
90
+ it('records the data given to it by the oracle', async () => {
91
+ await oc
92
+ .connect(roles.oracleNode)
93
+ .fulfillOracleRequest(...test_helpers_1.oracle.convertFufillParams(request, response));
94
+ const currentPrice = await cc.currentPrice();
95
+ chai_1.assert.equal(currentPrice, response);
96
+ });
97
+ it('logs the data given to it by the oracle', async () => {
98
+ var _a, _b, _c;
99
+ const tx = await oc
100
+ .connect(roles.oracleNode)
101
+ .fulfillOracleRequest(...test_helpers_1.oracle.convertFufillParams(request, response));
102
+ const receipt = await tx.wait();
103
+ chai_1.assert.equal(2, (_a = receipt.logs) === null || _a === void 0 ? void 0 : _a.length);
104
+ const log = (_b = receipt.logs) === null || _b === void 0 ? void 0 : _b[1];
105
+ chai_1.assert.equal((_c = log) === null || _c === void 0 ? void 0 : _c.topics[2], response);
106
+ });
107
+ describe('when the consumer does not recognize the request ID', () => {
108
+ let otherRequest;
109
+ beforeEach(async () => {
110
+ var _a;
111
+ const args = test_helpers_1.oracle.encodeOracleRequest(specId, cc.address, basicConsumerFactory.interface.functions.fulfill.sighash, 43, '0x0');
112
+ const tx = await link.transferAndCall(oc.address, 0, args);
113
+ const receipt = await tx.wait();
114
+ otherRequest = test_helpers_1.oracle.decodeRunRequest((_a = receipt.logs) === null || _a === void 0 ? void 0 : _a[2]);
115
+ });
116
+ it('does not accept the data provided', async () => {
117
+ await oc
118
+ .connect(roles.oracleNode)
119
+ .fulfillOracleRequest(...test_helpers_1.oracle.convertFufillParams(otherRequest, response));
120
+ const received = await cc.currentPrice();
121
+ chai_1.assert.equal(ethers_1.ethers.utils.parseBytes32String(received), '');
122
+ });
123
+ });
124
+ describe('when called by anyone other than the oracle contract', () => {
125
+ it('does not accept the data provided', async () => {
126
+ await test_helpers_1.matchers.evmRevert(async () => {
127
+ await cc
128
+ .connect(roles.oracleNode)
129
+ .fulfill(request.requestId, response);
130
+ });
131
+ const received = await cc.currentPrice();
132
+ chai_1.assert.equal(ethers_1.ethers.utils.parseBytes32String(received), '');
133
+ });
134
+ });
135
+ });
136
+ describe('#cancelRequest', () => {
137
+ const depositAmount = test_helpers_1.helpers.toWei('1');
138
+ let request;
139
+ beforeEach(async () => {
140
+ var _a;
141
+ await link.transfer(cc.address, depositAmount);
142
+ const tx = await cc.requestEthereumPrice(currency);
143
+ const receipt = await tx.wait();
144
+ request = test_helpers_1.oracle.decodeRunRequest((_a = receipt.logs) === null || _a === void 0 ? void 0 : _a[3]);
145
+ });
146
+ describe('before 5 minutes', () => {
147
+ it('cant cancel the request', async () => {
148
+ await test_helpers_1.matchers.evmRevert(async () => {
149
+ await cc
150
+ .connect(roles.consumer)
151
+ .cancelRequest(request.requestId, request.payment, request.callbackFunc, request.expiration);
152
+ });
153
+ });
154
+ });
155
+ describe('after 5 minutes', () => {
156
+ it('can cancel the request', async () => {
157
+ await test_helpers_1.helpers.increaseTime5Minutes(provider);
158
+ await cc
159
+ .connect(roles.consumer)
160
+ .cancelRequest(request.requestId, request.payment, request.callbackFunc, request.expiration);
161
+ });
162
+ });
163
+ });
164
+ describe('#withdrawLink', () => {
165
+ const depositAmount = test_helpers_1.helpers.toWei('1');
166
+ beforeEach(async () => {
167
+ await link.transfer(cc.address, depositAmount);
168
+ const balance = await link.balanceOf(cc.address);
169
+ test_helpers_1.matchers.bigNum(balance, depositAmount);
170
+ });
171
+ it('transfers LINK out of the contract', async () => {
172
+ await cc.connect(roles.consumer).withdrawLink();
173
+ const ccBalance = await link.balanceOf(cc.address);
174
+ const consumerBalance = ethers_1.ethers.utils.bigNumberify(await link.balanceOf(roles.consumer.address));
175
+ test_helpers_1.matchers.bigNum(ccBalance, 0);
176
+ test_helpers_1.matchers.bigNum(consumerBalance, depositAmount);
177
+ });
178
+ });
179
+ });
180
+ //# sourceMappingURL=BasicConsumer.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BasicConsumer.test.js","sourceRoot":"","sources":["../../test/BasicConsumer.test.ts"],"names":[],"mappings":";;;;;AAAA,0DAMgC;AAChC,gDAAuB;AACvB,+B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AK,CAAC,QAAQ,CAAC,OAAO,CAAC,CAC7C,CAAA;YACD,uBAAQ,CAAC,MAAM,CAAC,SAAS,EAAE,CAAC,CAAC,CAAA;YAC7B,uBAAQ,CAAC,MAAM,CAAC,eAAe,EAAE,aAAa,CAAC,CAAA;QACjD,CAAC,CAAC,CAAA;IACJ,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"}
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const test_helpers_1 = require("@chainlink/test-helpers");
4
+ const ChainlinkedFactory_1 = require("../src/generated/ChainlinkedFactory");
5
+ const chainlinkedFactory = new ChainlinkedFactory_1.ChainlinkedFactory();
6
+ describe('Chainlinked', () => {
7
+ it('has a limited public interface', async () => {
8
+ test_helpers_1.matchers.publicAbi(chainlinkedFactory, []);
9
+ });
10
+ });
11
+ //# sourceMappingURL=Chainlinked.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Chainlinked.test.js","sourceRoot":"","sources":["../../test/Chainlinked.test.ts"],"names":[],"mappings":";;AAAA,0DAAkD;AAClD,4EAAwE;AAExE,MAAM,kBAAkB,GAAG,IAAI,uCAAkB,EAAE,CAAA;AAEnD,QAAQ,CAAC,aAAa,EAAE,GAAG,EAAE;IAC3B,EAAE,CAAC,gCAAgC,EAAE,KAAK,IAAI,EAAE;QAC9C,uBAAQ,CAAC,SAAS,CAAC,kBAAkB,EAAE,EAAE,CAAC,CAAA;IAC5C,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"}
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,163 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const test_helpers_1 = require("@chainlink/test-helpers");
4
+ const chai_1 = require("chai");
5
+ const ethers_1 = require("ethers");
6
+ const ConcreteChainlinkFactory_1 = require("../src/generated/ConcreteChainlinkFactory");
7
+ const provider = test_helpers_1.setup.provider();
8
+ const concreteChainlinkFactory = new ConcreteChainlinkFactory_1.ConcreteChainlinkFactory();
9
+ const debug = test_helpers_1.debug.makeDebug('ConcreteChainlink');
10
+ describe('ConcreteChainlink', () => {
11
+ let ccl;
12
+ let defaultAccount;
13
+ const deployment = test_helpers_1.setup.snapshot(provider, async () => {
14
+ defaultAccount = await test_helpers_1.setup
15
+ .users(provider)
16
+ .then(r => r.roles.defaultAccount);
17
+ ccl = await concreteChainlinkFactory.connect(defaultAccount).deploy();
18
+ });
19
+ beforeEach(async () => {
20
+ await deployment();
21
+ });
22
+ it('has a limited public interface', () => {
23
+ test_helpers_1.matchers.publicAbi(concreteChainlinkFactory, [
24
+ 'add',
25
+ 'addBytes',
26
+ 'addInt',
27
+ 'addStringArray',
28
+ 'addUint',
29
+ 'closeEvent',
30
+ 'setBuffer',
31
+ ]);
32
+ });
33
+ async function parseCCLEvent(tx) {
34
+ var _a;
35
+ const receipt = await tx.wait();
36
+ const data = (_a = receipt.logs) === null || _a === void 0 ? void 0 : _a[0].data;
37
+ const d = debug.extend('parseCCLEvent');
38
+ d('data %s', data);
39
+ return ethers_1.ethers.utils.defaultAbiCoder.decode(['bytes'], (data !== null && data !== void 0 ? data : ''));
40
+ }
41
+ describe('#close', () => {
42
+ it('handles empty payloads', async () => {
43
+ const tx = await ccl.closeEvent();
44
+ const [payload] = await parseCCLEvent(tx);
45
+ const decoded = await test_helpers_1.helpers.decodeDietCBOR(payload);
46
+ chai_1.assert.deepEqual(decoded, {});
47
+ });
48
+ });
49
+ describe('#setBuffer', () => {
50
+ it('emits the buffer', async () => {
51
+ await ccl.setBuffer('0xA161616162');
52
+ const tx = await ccl.closeEvent();
53
+ const [payload] = await parseCCLEvent(tx);
54
+ const decoded = await test_helpers_1.helpers.decodeDietCBOR(payload);
55
+ chai_1.assert.deepEqual(decoded, { a: 'b' });
56
+ });
57
+ });
58
+ describe('#add', () => {
59
+ it('stores and logs keys and values', async () => {
60
+ await ccl.add('first', 'word!!');
61
+ const tx = await ccl.closeEvent();
62
+ const [payload] = await parseCCLEvent(tx);
63
+ const decoded = await test_helpers_1.helpers.decodeDietCBOR(payload);
64
+ chai_1.assert.deepEqual(decoded, { first: 'word!!' });
65
+ });
66
+ it('handles two entries', async () => {
67
+ await ccl.add('first', 'uno');
68
+ await ccl.add('second', 'dos');
69
+ const tx = await ccl.closeEvent();
70
+ const [payload] = await parseCCLEvent(tx);
71
+ const decoded = await test_helpers_1.helpers.decodeDietCBOR(payload);
72
+ chai_1.assert.deepEqual(decoded, {
73
+ first: 'uno',
74
+ second: 'dos',
75
+ });
76
+ });
77
+ });
78
+ describe('#addBytes', () => {
79
+ it('stores and logs keys and values', async () => {
80
+ await ccl.addBytes('first', '0xaabbccddeeff');
81
+ const tx = await ccl.closeEvent();
82
+ const [payload] = await parseCCLEvent(tx);
83
+ const decoded = await test_helpers_1.helpers.decodeDietCBOR(payload);
84
+ const expected = test_helpers_1.helpers.hexToBuf('0xaabbccddeeff');
85
+ chai_1.assert.deepEqual(decoded, { first: expected });
86
+ });
87
+ it('handles two entries', async () => {
88
+ await ccl.addBytes('first', '0x756E6F');
89
+ await ccl.addBytes('second', '0x646F73');
90
+ const tx = await ccl.closeEvent();
91
+ const [payload] = await parseCCLEvent(tx);
92
+ const decoded = await test_helpers_1.helpers.decodeDietCBOR(payload);
93
+ const expectedFirst = test_helpers_1.helpers.hexToBuf('0x756E6F');
94
+ const expectedSecond = test_helpers_1.helpers.hexToBuf('0x646F73');
95
+ chai_1.assert.deepEqual(decoded, {
96
+ first: expectedFirst,
97
+ second: expectedSecond,
98
+ });
99
+ });
100
+ it('handles strings', async () => {
101
+ await ccl.addBytes('first', ethers_1.ethers.utils.toUtf8Bytes('apple'));
102
+ const tx = await ccl.closeEvent();
103
+ const [payload] = await parseCCLEvent(tx);
104
+ const decoded = await test_helpers_1.helpers.decodeDietCBOR(payload);
105
+ const expected = ethers_1.ethers.utils.toUtf8Bytes('apple');
106
+ chai_1.assert.deepEqual(decoded, { first: expected });
107
+ });
108
+ });
109
+ describe('#addInt', () => {
110
+ it('stores and logs keys and values', async () => {
111
+ await ccl.addInt('first', 1);
112
+ const tx = await ccl.closeEvent();
113
+ const [payload] = await parseCCLEvent(tx);
114
+ const decoded = await test_helpers_1.helpers.decodeDietCBOR(payload);
115
+ chai_1.assert.deepEqual(decoded, { first: 1 });
116
+ });
117
+ it('handles two entries', async () => {
118
+ await ccl.addInt('first', 1);
119
+ await ccl.addInt('second', 2);
120
+ const tx = await ccl.closeEvent();
121
+ const [payload] = await parseCCLEvent(tx);
122
+ const decoded = await test_helpers_1.helpers.decodeDietCBOR(payload);
123
+ chai_1.assert.deepEqual(decoded, {
124
+ first: 1,
125
+ second: 2,
126
+ });
127
+ });
128
+ });
129
+ describe('#addUint', () => {
130
+ it('stores and logs keys and values', async () => {
131
+ await ccl.addUint('first', 1);
132
+ const tx = await ccl.closeEvent();
133
+ const [payload] = await parseCCLEvent(tx);
134
+ const decoded = await test_helpers_1.helpers.decodeDietCBOR(payload);
135
+ chai_1.assert.deepEqual(decoded, { first: 1 });
136
+ });
137
+ it('handles two entries', async () => {
138
+ await ccl.addUint('first', 1);
139
+ await ccl.addUint('second', 2);
140
+ const tx = await ccl.closeEvent();
141
+ const [payload] = await parseCCLEvent(tx);
142
+ const decoded = await test_helpers_1.helpers.decodeDietCBOR(payload);
143
+ chai_1.assert.deepEqual(decoded, {
144
+ first: 1,
145
+ second: 2,
146
+ });
147
+ });
148
+ });
149
+ describe('#addStringArray', () => {
150
+ it('stores and logs keys and values', async () => {
151
+ await ccl.addStringArray('word', [
152
+ ethers_1.ethers.utils.formatBytes32String('seinfeld'),
153
+ ethers_1.ethers.utils.formatBytes32String('"4"'),
154
+ ethers_1.ethers.utils.formatBytes32String('LIFE'),
155
+ ]);
156
+ const tx = await ccl.closeEvent();
157
+ const [payload] = await parseCCLEvent(tx);
158
+ const decoded = await test_helpers_1.helpers.decodeDietCBOR(payload);
159
+ chai_1.assert.deepEqual(decoded, { word: ['seinfeld', '"4"', 'LIFE'] });
160
+ });
161
+ });
162
+ });
163
+ //# sourceMappingURL=ConcreteChainlink.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ConcreteChainlink.test.js","sourceRoot":"","sources":["../../test/ConcreteChainlink.test.ts"],"names":[],"mappings":";;AAAA,0DAMgC;AAChC,+BAA6B;AAC7B,mCAA+B;AAC/B,wFAAoF;AAEpF,MAAM,QAAQ,GAAG,oBAAK,CAAC,QAAQ,EAAE,CAAA;AACjC,MAAM,wBAAwB,GAAG,IAAI,mDAAwB,EAAE,CAAA;AAC/D,MAAM,KAAK,GAAG,oBAAC,CAAC,SAAS,CAAC,mBAAmB,CAAC,CAAA;AAE9C,QAAQ,CAAC,mBAAmB,EAAE,GAAG,EAAE;IACjC,IAAI,GAAgD,CAAA;IACpD,IAAI,cAA6B,CAAA;IACjC,MAAM,UAAU,GAAG,oBAAK,CAAC,QAAQ,CAAC,QAAQ,EAAE,KAAK,IAAI,EAAE;QACrD,cAAc,GAAG,MAAM,oBAAK;aACzB,KAAK,CAAC,QAAQ,CAAC;aACf,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,cAAc,CAAC,CAAA;QACpC,GAAG,GAAG,MAAM,wBAAwB,CAAC,OAAO,CAAC,cAAc,CAAC,CAAC,MAAM,EAAE,CAAA;IACvE,CAAC,CAAC,CAAA;IAEF,UAAU,CAAC,KAAK,IAAI,EAAE;QACpB,MAAM,UAAU,EAAE,CAAA;IACpB,CAAC,CAAC,CAAA;IAEF,EAAE,CAAC,gCAAgC,EAAE,GAAG,EAAE;QACxC,uBAAQ,CAAC,SAAS,CAAC,wBAAwB,EAAE;YAC3C,KAAK;YACL,UAAU;YACV,QAAQ;YACR,gBAAgB;YAChB,SAAS;YACT,YAAY;YACZ,WAAW;SACZ,CAAC,CAAA;IACJ,CAAC,CAAC,CAAA;IAEF,KAAK,UAAU,aAAa,CAAC,EAAwC;;QACnE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