Convex-Dev / convex

Convex Main Repository - Decentralised platform for the Internet of Value
https://convex.world
Other
95 stars 30 forks source link

Unexpectedly getting: is not a callable function: add-value #508

Closed ash-mcc closed 6 months ago

ash-mcc commented 6 months ago

When I deploy oracle-sc as per https://convex.world/cvm/accounts/actors The call: (call oracle-sc (add-value 1)) I unexpectedly get: Exception: :STATE Value defined in account #54 is not a callable function: add-value Detail...

(call oracle-sc
      (add-value 1))
 Exception: :STATE Value defined in account #54 is not a callable function: add-value
 - In core function: call*
 - In expression: (call* #12/oracle-sc 0 add-value 1)

(account oracle-sc)
 => {:sequence 0,:key nil,:balance 0,:allowance 0,:holdings {},:controller nil,:environment {values [],add-value (fn [x] (do (cond (= *caller* #54/trust-addr) nil (fail :TRUST "Only original creator can add values.")) (def values (conj values %0)))),trust-addr #12},:metadata {add-value {:callable? true}},:parent nil}

...so add-value is marked as :callable?.

ash-mcc commented 6 months ago
uname -a
Darwin d215132.stir.ac.uk 23.3.0 Darwin Kernel Version 23.3.0: Wed Dec 20 21:33:31 PST 2023; root:xnu-10002.81.5~7/RELEASE_ARM64_T8112 arm64

java --version
openjdk 21.0.3 2024-04-16
OpenJDK Runtime Environment Homebrew (build 21.0.3)
OpenJDK 64-Bit Server VM Homebrew (build 21.0.3, mixed mode, sharing)

./convex --version
Convex version: 0.7.13-SNAPSHOT
ash-mcc commented 6 months ago

...ah, you've switched from :callable? to :callable.

mikera commented 5 months ago

Yes we made the change recently, it is more consistent with other similar conventions (e.g. ^:static in Clojure)