github.com/smartcontractkit/chainlink-terra@v0.1.4/tests/e2e/ocr2types/ocr2.go (about) 1 package ocr2types 2 3 import ( 4 "math/big" 5 6 "github.com/smartcontractkit/terra.go/msg" 7 ) 8 9 const ( 10 QueryLatestConfigDetails = "latest_config_details" 11 QueryTransmitters = "transmitters" 12 QueryLatestTransmissionDetails = "latest_transmission_details" 13 QueryLatestConfigDigestAndEpoch = "latest_config_digest_and_epoch" 14 QueryDescription = "description" 15 QueryDecimals = "decimals" 16 QueryLatestRoundData = "latest_round_data" 17 QueryLinkToken = "link_token" 18 QueryBilling = "billing" 19 QueryBillingAccessController = "billing_access_controller" 20 QueryRequesterAccessController = "requester_access_controller" 21 QueryLinkAvailableForPayment = "link_available_for_payment" 22 ) 23 24 type QueryLatestRoundDataResponse struct { 25 QueryResult struct { 26 Answer string `json:"answer"` 27 ObservationsTimestamp uint64 `json:"observations_timestamp"` 28 RoundID uint64 `json:"round_id"` 29 TransmissionTimestamp uint64 `json:"transmission_timestamp"` 30 } `json:"query_result"` 31 } 32 33 type QueryOwedPaymentMsg struct { 34 OwedPayment QueryOwedPaymentTypeMsg `json:"owed_payment"` 35 } 36 37 type QueryOwedPaymentTypeMsg struct { 38 Transmitter msg.AccAddress `json:"transmitter"` 39 } 40 41 type QueryRoundDataMsg struct { 42 RoundData QueryRoundDataTypeMsg `json:"round_data"` 43 } 44 45 type QueryRoundDataTypeMsg struct { 46 RoundID uint32 `json:"round_id"` 47 } 48 49 type OCRv2InstantiateMsg struct { 50 BillingAccessController string `json:"billing_access_controller"` 51 RequesterAccessController string `json:"requester_access_controller"` 52 LinkToken string `json:"link_token"` 53 Decimals uint8 `json:"decimals"` 54 Description string `json:"description"` 55 MinAnswer string `json:"min_answer"` 56 MaxAnswer string `json:"max_answer"` 57 } 58 59 // ExecuteSetValidator execute set validator msg 60 type ExecuteSetValidator struct { 61 SetValidator ExecuteSetValidatorConfig `json:"set_validator_config"` 62 } 63 64 // ExecuteSetValidatorConfig execute set validator msg 65 type ExecuteSetValidatorConfig struct { 66 Config ExecuteSetValidatorConfigType `json:"config"` 67 } 68 69 // ExecuteSetValidatorConfigType execute set validator msg 70 type ExecuteSetValidatorConfigType struct { 71 Address string `json:"address"` 72 GasLimit uint64 `json:"gas_limit"` 73 } 74 75 // ExecuteSetPayees set payees msg 76 type ExecuteSetPayees struct { 77 SetPayees ExecuteSetPayeesConfig `json:"set_payees"` 78 } 79 80 // ExecuteSetPayeesConfig set payees msg 81 type ExecuteSetPayeesConfig struct { 82 Payees [][]string `json:"payees"` 83 } 84 85 type ExecuteSetBillingMsg struct { 86 SetBilling ExecuteSetBillingMsgType `json:"set_billing"` 87 } 88 89 type ExecuteSetBillingMsgType struct { 90 Config ExecuteSetBillingConfigMsgType `json:"config"` 91 } 92 93 type ExecuteSetBillingConfigMsgType struct { 94 BaseGas uint64 `json:"base_gas"` 95 TransmissionPayment uint64 `json:"transmission_payment_gjuels"` 96 ObservationPayment uint64 `json:"observation_payment_gjuels"` 97 RecommendedGasPrice string `json:"recommended_gas_price_micro"` 98 } 99 100 type ExecuteTransferOwnershipMsg struct { 101 TransferOwnership ExecuteTransferOwnershipMsgType `json:"transfer_ownership"` 102 } 103 104 type ExecuteTransferOwnershipMsgType struct { 105 To msg.AccAddress `json:"to"` 106 } 107 108 var BeginProposal = "begin_proposal" 109 110 type ProposeConfig struct { 111 ProposeConfig ProposeConfigDetails `json:"propose_config"` 112 } 113 114 type ProposeConfigDetails struct { 115 ID string `json:"id"` 116 Payees []string `json:"payees"` 117 Signers [][]byte `json:"signers"` 118 Transmitters []string `json:"transmitters"` 119 F uint8 `json:"f"` 120 OnchainConfig []byte `json:"onchain_config"` 121 } 122 123 type ProposeOffchainConfig struct { 124 ProposeOffchainConfig ProposeOffchainConfigDetails `json:"propose_offchain_config"` 125 } 126 127 type ProposeOffchainConfigDetails struct { 128 ID string `json:"id"` 129 OffchainConfigVersion uint64 `json:"offchain_config_version"` 130 OffchainConfig []byte `json:"offchain_config"` 131 } 132 133 type ClearProposal struct { 134 ClearProposal ClearProposalDetails `json:"clear_proposal"` 135 } 136 137 type ClearProposalDetails struct { 138 ID *big.Int `json:"id"` 139 } 140 141 type FinalizeProposal struct { 142 FinalizeProposal FinalizeProposalDetails `json:"finalize_proposal"` 143 } 144 145 type FinalizeProposalDetails struct { 146 ID string `json:"id"` 147 } 148 149 type AcceptProposal struct { 150 AcceptProposal AcceptProposalDetails `json:"accept_proposal"` 151 } 152 153 type AcceptProposalDetails struct { 154 ID string `json:"id"` 155 Digest []byte `json:"digest"` 156 }