Skip to content

Commit

Permalink
PT-167970620 - Add GA Attach/Meta Tx definition in swagger yaml/json (#…
Browse files Browse the repository at this point in the history
…2669)

* add GAAttachTx to the swagger.yaml file
* add GAMetaTx to the swagger.yaml file
* fix cardinality for signatures in generic signed tx
* generate swagger.json with make swagger command
  • Loading branch information
noandrea authored and dincho committed Aug 21, 2019
1 parent a471e33 commit f90a2cc
Show file tree
Hide file tree
Showing 2 changed files with 181 additions and 6 deletions.
100 changes: 97 additions & 3 deletions apps/aehttp/priv/swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -3259,11 +3259,10 @@
},
"signatures" : {
"type" : "array",
"description" : "signatures required unless for Generalized Account Meta transactions",
"description" : "At least one signature is required unless for Generalized Account Meta transactions",
"items" : {
"$ref" : "#/definitions/EncodedValue"
},
"minItems" : 1
}
}
},
"example" : {
Expand Down Expand Up @@ -3440,6 +3439,20 @@
"$ref" : "#/definitions/ContractCallTx"
} ]
},
"GAAttachTxJSON" : {
"allOf" : [ {
"$ref" : "#/definitions/GenericTx"
}, {
"$ref" : "#/definitions/GAAttachTx"
} ]
},
"GAMetaTxJSON" : {
"allOf" : [ {
"$ref" : "#/definitions/GenericTx"
}, {
"$ref" : "#/definitions/GAMetaTx"
} ]
},
"TxInfoObject" : {
"type" : "object",
"properties" : {
Expand Down Expand Up @@ -4173,6 +4186,87 @@
"accounts" : { }
}
},
"GAAttachTx" : {
"type" : "object",
"required" : [ "abi_version", "auth_fun", "call_data", "code", "fee", "gas", "gas_price", "owner_id", "vm_version" ],
"properties" : {
"owner_id" : {
"description" : "Contract owner pub_key",
"$ref" : "#/definitions/EncodedPubkey"
},
"nonce" : {
"description" : "Owner's nonce",
"$ref" : "#/definitions/UInt64"
},
"code" : {
"description" : "Contract's code",
"$ref" : "#/definitions/EncodedByteArray"
},
"vm_version" : {
"description" : "Virtual machine's version",
"$ref" : "#/definitions/UInt16"
},
"abi_version" : {
"description" : "ABI version",
"$ref" : "#/definitions/UInt16"
},
"gas" : {
"$ref" : "#/definitions/UInt64"
},
"gas_price" : {
"$ref" : "#/definitions/UInt"
},
"fee" : {
"$ref" : "#/definitions/UInt"
},
"ttl" : {
"$ref" : "#/definitions/UInt64"
},
"call_data" : {
"description" : "Contract call data",
"$ref" : "#/definitions/EncodedByteArray"
},
"auth_fun" : {
"type" : "string",
"description" : "Contract authorization function hash (hex encoded)",
"pattern" : "^(0x|0X)?[a-fA-F0-9]+$'"
}
}
},
"GAMetaTx" : {
"type" : "object",
"required" : [ "abi_version", "auth_data", "fee", "ga_id", "gas", "gas_price", "tx" ],
"properties" : {
"ga_id" : {
"description" : "Account owner pub_key",
"$ref" : "#/definitions/EncodedPubkey"
},
"abi_version" : {
"description" : "ABI version",
"$ref" : "#/definitions/UInt16"
},
"gas" : {
"$ref" : "#/definitions/UInt64"
},
"gas_price" : {
"$ref" : "#/definitions/UInt"
},
"fee" : {
"$ref" : "#/definitions/UInt"
},
"ttl" : {
"$ref" : "#/definitions/UInt64"
},
"auth_data" : {
"description" : "Contract authorization function call data",
"$ref" : "#/definitions/EncodedByteArray"
},
"tx" : {
"description" : "Enclosed signed transaction",
"$ref" : "#/definitions/GenericSignedTx"
}
}
},
"inline_response_200" : {
"properties" : {
"hash" : {
Expand Down
87 changes: 84 additions & 3 deletions config/swagger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2618,9 +2618,8 @@ definitions:
hash:
$ref: '#/definitions/EncodedHash'
signatures:
description: 'signatures required unless for Generalized Account Meta transactions'
description: 'At least one signature is required unless for Generalized Account Meta transactions'
type: array
minItems: 1
items:
$ref: '#/definitions/EncodedValue'
required:
Expand Down Expand Up @@ -2723,6 +2722,14 @@ definitions:
allOf:
- $ref: '#/definitions/GenericTx'
- $ref: '#/definitions/ContractCallTx'
GAAttachTxJSON:
allOf:
- $ref: '#/definitions/GenericTx'
- $ref: '#/definitions/GAAttachTx'
GAMetaTxJSON:
allOf:
- $ref: '#/definitions/GenericTx'
- $ref: '#/definitions/GAMetaTx'
TxInfoObject:
type: object
properties:
Expand Down Expand Up @@ -3196,7 +3203,81 @@ definitions:
total:
description: Sum of all tokens from other fields
$ref: '#/definitions/UInt'

GAAttachTx:
type: object
properties:
owner_id:
$ref: '#/definitions/EncodedPubkey'
description: Contract owner pub_key
nonce:
description: 'Owner''s nonce'
$ref: '#/definitions/UInt64'
code:
description: 'Contract''s code'
$ref: '#/definitions/EncodedByteArray'
vm_version:
description: 'Virtual machine''s version'
$ref: '#/definitions/UInt16'
abi_version:
description: 'ABI version'
$ref: '#/definitions/UInt16'
gas:
$ref: '#/definitions/UInt64'
gas_price:
$ref: '#/definitions/UInt'
fee:
$ref: '#/definitions/UInt'
ttl:
$ref: '#/definitions/UInt64'
call_data:
description: Contract call data
$ref: '#/definitions/EncodedByteArray'
auth_fun:
description: Contract authorization function hash (hex encoded)
type: string
pattern: ^(0x|0X)?[a-fA-F0-9]+$'
required:
- owner_id
- code
- vm_version
- abi_version
- gas
- gas_price
- fee
- call_data
- auth_fun
GAMetaTx:
type: object
properties:
ga_id:
$ref: '#/definitions/EncodedPubkey'
description: Account owner pub_key
abi_version:
description: 'ABI version'
$ref: '#/definitions/UInt16'
gas:
$ref: '#/definitions/UInt64'
gas_price:
$ref: '#/definitions/UInt'
fee:
$ref: '#/definitions/UInt'
ttl:
$ref: '#/definitions/UInt64'
auth_data:
description: Contract authorization function call data
$ref: '#/definitions/EncodedByteArray'
tx:
description: Enclosed signed transaction
$ref: '#/definitions/GenericSignedTx'
required:
- ga_id
- abi_version
- gas
- gas_price
- fee
- auth_data
- tx

externalDocs:
description: Find out more about Aeternity
url: 'http://www.aeternity.com'
Expand Down

0 comments on commit f90a2cc

Please sign in to comment.