Skip to content

Commit a74f32c

Browse files
committed
is method and test
1 parent cacd3d7 commit a74f32c

File tree

36 files changed

+8525
-11
lines changed

36 files changed

+8525
-11
lines changed
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import * as _0 from "./deployment/v1beta1/authz";
2+
export namespace akash {
3+
export namespace deployment {
4+
export const v1beta1 = {
5+
..._0
6+
};
7+
}
8+
}
Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
import { Coin } from "../../../cosmos/base/v1beta1/coin";
2+
import { BinaryReader, BinaryWriter } from "../../../binary";
3+
import { isSet, DeepPartial } from "../../../helpers";
4+
import { GlobalDecoderRegistry } from "../../../registry";
5+
export const protobufPackage = "akash.deployment.v1beta1";
6+
/**
7+
* DepositDeploymentAuthorization allows the grantee to deposit up to spend_limit coins from
8+
* the granter's account for a deployment.
9+
*/
10+
export interface DepositDeploymentAuthorization {
11+
/**
12+
* SpendLimit is the amount the grantee is authorized to spend from the granter's account for
13+
* the purpose of deployment.
14+
*/
15+
spendLimit: Coin;
16+
}
17+
export interface DepositDeploymentAuthorizationProtoMsg {
18+
typeUrl: "/akash.deployment.v1beta1.DepositDeploymentAuthorization";
19+
value: Uint8Array;
20+
}
21+
function createBaseDepositDeploymentAuthorization(): DepositDeploymentAuthorization {
22+
return {
23+
spendLimit: Coin.fromPartial({})
24+
};
25+
}
26+
export const DepositDeploymentAuthorization = {
27+
typeUrl: "/akash.deployment.v1beta1.DepositDeploymentAuthorization",
28+
is(o: any): o is DepositDeploymentAuthorization {
29+
return o && o.$typeUrl === DepositDeploymentAuthorization.typeUrl && o;
30+
},
31+
encode(message: DepositDeploymentAuthorization, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter {
32+
if (message.spendLimit !== undefined) {
33+
Coin.encode(message.spendLimit, writer.uint32(10).fork()).ldelim();
34+
}
35+
return writer;
36+
},
37+
decode(input: BinaryReader | Uint8Array, length?: number): DepositDeploymentAuthorization {
38+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
39+
let end = length === undefined ? reader.len : reader.pos + length;
40+
const message = createBaseDepositDeploymentAuthorization();
41+
while (reader.pos < end) {
42+
const tag = reader.uint32();
43+
switch (tag >>> 3) {
44+
case 1:
45+
message.spendLimit = Coin.decode(reader, reader.uint32());
46+
break;
47+
default:
48+
reader.skipType(tag & 7);
49+
break;
50+
}
51+
}
52+
return message;
53+
},
54+
fromJSON(object: any): DepositDeploymentAuthorization {
55+
const obj = createBaseDepositDeploymentAuthorization();
56+
if (isSet(object.spendLimit)) obj.spendLimit = Coin.fromJSON(object.spendLimit);
57+
return obj;
58+
},
59+
toJSON(message: DepositDeploymentAuthorization): unknown {
60+
const obj: any = {};
61+
message.spendLimit !== undefined && (obj.spendLimit = message.spendLimit ? Coin.toJSON(message.spendLimit) : undefined);
62+
return obj;
63+
},
64+
fromPartial(object: DeepPartial<DepositDeploymentAuthorization>): DepositDeploymentAuthorization {
65+
const message = createBaseDepositDeploymentAuthorization();
66+
if (object.spendLimit !== undefined && object.spendLimit !== null) {
67+
message.spendLimit = Coin.fromPartial(object.spendLimit);
68+
}
69+
return message;
70+
},
71+
fromProtoMsg(message: DepositDeploymentAuthorizationProtoMsg): DepositDeploymentAuthorization {
72+
return DepositDeploymentAuthorization.decode(message.value);
73+
},
74+
toProto(message: DepositDeploymentAuthorization): Uint8Array {
75+
return DepositDeploymentAuthorization.encode(message).finish();
76+
},
77+
toProtoMsg(message: DepositDeploymentAuthorization): DepositDeploymentAuthorizationProtoMsg {
78+
return {
79+
typeUrl: "/akash.deployment.v1beta1.DepositDeploymentAuthorization",
80+
value: DepositDeploymentAuthorization.encode(message).finish()
81+
};
82+
}
83+
};
84+
GlobalDecoderRegistry.register(DepositDeploymentAuthorization.typeUrl, DepositDeploymentAuthorization);

0 commit comments

Comments
 (0)