Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat: Cosmos SDK 47 #109

Merged
merged 87 commits into from
Dec 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
87 commits
Select commit Hold shift + click to select a range
bb21885
feat: add ResubmitSchedule neutron msg
NeverHappened Aug 11, 2023
43de8e7
add Failures binding query
NeverHappened Aug 14, 2023
96e756a
Fix pagination request PageRequest
NeverHappened Aug 16, 2023
52fec88
add new binding
quasisamurai Aug 17, 2023
1891649
fix Failure types for serialization
NeverHappened Aug 17, 2023
a472255
remove old bindings, intro new one
quasisamurai Aug 23, 2023
97dddc6
comms
quasisamurai Aug 23, 2023
c2d16c9
w o string
quasisamurai Aug 24, 2023
c29a31c
rm rudiment
quasisamurai Aug 24, 2023
157f63d
value
quasisamurai Aug 24, 2023
cfb3c83
explicit string typing due the cw limitations
quasisamurai Aug 25, 2023
697d826
rm legacy code
quasisamurai Aug 25, 2023
d78d9b6
Merge pull request #106 from neutron-org/feat/contract-manager-resubmit
pr0n00gler Sep 5, 2023
756a026
more precise comments
quasisamurai Sep 6, 2023
51c5d33
Merge pull request #107 from neutron-org/feat/sdk47
pr0n00gler Sep 7, 2023
2c9e8e6
add set before send hook binding
quasisamurai Sep 8, 2023
f85ea51
fmtt
quasisamurai Sep 8, 2023
09b603e
queries
quasisamurai Sep 8, 2023
1161257
fix query
quasisamurai Sep 8, 2023
67df470
fix comment
quasisamurai Sep 11, 2023
e6bd065
fix commets
quasisamurai Sep 12, 2023
39dcea6
comment
quasisamurai Sep 12, 2023
9609e48
upd query
quasisamurai Sep 13, 2023
8f88658
added register_fee field
swelf19 Sep 15, 2023
549595c
rename cosmwasm_address -> contract_addr for set hook msg
NeverHappened Sep 19, 2023
82eb7e8
Merge pull request #112 from neutron-org/feat/ica-register-fee
pr0n00gler Sep 19, 2023
9626f30
Merge pull request #110 from neutron-org/feat/tokenfactory-update
pr0n00gler Sep 20, 2023
e2ef838
update version of sdk to 1.7.0; deprecate old admin proposals
NeverHappened Sep 28, 2023
ba7d2e1
improve comments
NeverHappened Sep 28, 2023
6bcda2c
make schema
NeverHappened Sep 28, 2023
5ecde7d
Merge pull request #114 from neutron-org/fix/deprecate-old-admin-prop…
pr0n00gler Oct 10, 2023
7249d53
fee optional
quasisamurai Oct 24, 2023
afab40f
Merge pull request #118 from neutron-org/feat/ica-register-fee-update
pr0n00gler Nov 3, 2023
b201a29
Merge branch 'main' into sdk/47
pr0n00gler Nov 3, 2023
276fc51
lint, fmt, update rust toolchain in github workflow
pr0n00gler Nov 3, 2023
6858ccd
dex proto types
NeverHappened Nov 16, 2023
1e4ed27
add proto-build
NeverHappened Nov 16, 2023
b35f448
Merge branch 'sdk/47' into feat/dex-proto
pr0n00gler Nov 16, 2023
4e4c3fe
dex proto
pr0n00gler Nov 16, 2023
010da08
regenerate neutron protos and expose them in mod
Nov 23, 2023
7c02c63
fix issues across deps versions for generated proto files
Nov 23, 2023
d4b0d8a
add stragate queries to dex module (wip)
Nov 23, 2023
ab96761
add all query and msg stargate helpers for the dex module
sotnikov-s Nov 24, 2023
6247e6c
refactor dex msg helpers to accept list of adapted params instead of …
sotnikov-s Nov 28, 2023
9a59bb8
refine proto msg encoding
sotnikov-s Nov 28, 2023
aa40227
fix proto msg type urls
sotnikov-s Nov 28, 2023
f0392fa
replace info param with sender string in dex helpers
sotnikov-s Nov 28, 2023
7cdfb67
refine parameters naming for deposit helper and type for place limit …
sotnikov-s Nov 28, 2023
708778e
add helpers for all remaining dex stargate queries
sotnikov-s Nov 29, 2023
1bd0701
move convert_timestamp to aux
sotnikov-s Nov 30, 2023
3b4bb3f
refactor dex query helpers to accept list of adapted params instead o…
sotnikov-s Nov 30, 2023
c31d833
fix linter concerns
sotnikov-s Nov 30, 2023
f8f423a
decode query result as base64
sotnikov-s Nov 30, 2023
c7c664a
debug: add stargate query resp debug logging
sotnikov-s Nov 30, 2023
c3c1313
polish mod.rs of proto_types
sotnikov-s Nov 30, 2023
eb0b075
move proto_types to stargate package
sotnikov-s Dec 1, 2023
4d3e10e
define req and resp types for dex stargate queries and refactor respe…
sotnikov-s Dec 1, 2023
34cdeda
add missing field to Params struct
sotnikov-s Dec 1, 2023
affade5
debug: add stargate query resp logging
sotnikov-s Dec 1, 2023
2666e97
replace primitive number types with cosmwasm_std ones deserealized in…
sotnikov-s Dec 1, 2023
7cd9d9e
normalize stargate dex responses
sotnikov-s Dec 1, 2023
0ff9d28
add consts and comments to dex types
sotnikov-s Dec 5, 2023
8a4d48b
remove debug logging for make_stargate_query
sotnikov-s Dec 5, 2023
a3e0cc9
rm proto-build dir
sotnikov-s Dec 5, 2023
c87c96a
rm neutron submodule
sotnikov-s Dec 5, 2023
bca1b59
remove the rest of the proto build stuff
sotnikov-s Dec 5, 2023
560743c
reflect and describe stargate package in readme
sotnikov-s Dec 5, 2023
1599d46
refactor dex msg helpers with accepting request structures
sotnikov-s Dec 5, 2023
dd81e0e
rm serde_repr from deps
sotnikov-s Dec 5, 2023
96c7f86
make proto_types package public
sotnikov-s Dec 5, 2023
558dcbe
fix misprint in LimitOrderTrancheUserAllResponse type name
sotnikov-s Dec 5, 2023
f3b1800
replace expiration_time i64 type with Int64
sotnikov-s Dec 5, 2023
937865c
rm redundant lib prefix for CosmosMsg::Stargate
sotnikov-s Dec 11, 2023
f8a4721
add comments for make_stargate_query and create_stargate_msg
sotnikov-s Dec 11, 2023
4fa9c69
improve convert_timestamp naming and add description
sotnikov-s Dec 11, 2023
b3ea975
make stargate helper funcs public
sotnikov-s Dec 11, 2023
7db0a7a
move proto_types stargate's module to a standalone package
sotnikov-s Dec 11, 2023
4b37021
move dex-related files to a dex submodule in stargate package
sotnikov-s Dec 11, 2023
520022f
cover dex stargate helpers with comments
sotnikov-s Dec 13, 2023
d280443
Merge pull request #121 from neutron-org/feat/dex-proto
pr0n00gler Dec 14, 2023
89b04ff
add missing stargate feature for cosmwasm-sdt import
sotnikov-s Dec 15, 2023
10e0ace
generate schema
sotnikov-s Dec 15, 2023
cbb934d
add/polish stargate queries desc for dex module
sotnikov-s Dec 15, 2023
b4379e8
Merge pull request #123 from neutron-org/fix/stargate-module-cleanup
pr0n00gler Dec 15, 2023
ac6ec2f
swap req and path params in make_stargate_query and create_stargate_msg
sotnikov-s Dec 20, 2023
98f51ec
parametrize stargate msg helpers with CosmosMsg<NeutronMsg>
sotnikov-s Dec 20, 2023
9d91a00
regenerate proto against reformat proto neutron branch
Dec 20, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
fetch-depth: 1
- uses: actions-rs/toolchain@v1
with:
toolchain: 1.68.2
toolchain: 1.71.0
components: clippy
profile: minimal
override: true
Expand All @@ -31,7 +31,7 @@ jobs:
fetch-depth: 1
- uses: actions-rs/toolchain@v1
with:
toolchain: 1.68.2
toolchain: 1.71.0
components: rustfmt
profile: minimal
override: true
Expand All @@ -49,7 +49,7 @@ jobs:
fetch-depth: 1
- uses: actions-rs/toolchain@v1
with:
toolchain: 1.68.2
toolchain: 1.71.0
profile: minimal
- run: cargo fetch --verbose
- run: cargo build
Expand Down
4 changes: 3 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,12 @@ serde-json-wasm = "1.0.0"
cw-storage-plus = "1.1.0"
cosmwasm-schema = { version = "1.4.0", default-features = false }
base64 = "0.21.4"
prost = "0.12.1"
prost = "0.12.3"
prost-types = "0.12.1"
cosmos-sdk-proto = { version = "0.20.0", default-features = false }
bech32 = "0.9.1"
thiserror = "1.0.49"
protobuf = { version = "3.3.0" }
hex = "0.4.3"
tendermint-proto = "0.34"
speedate = "0.13.0"
5 changes: 1 addition & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,11 @@ clippy:
fmt:
@cargo fmt -- --check

build_proto:
@./build_proto.sh

compile:
@./build_release.sh

check_contracts:
@cargo install cosmwasm-check
@cosmwasm-check --available-capabilities iterator,staking,stargate,neutron artifacts/*.wasm

build: build_proto schema clippy test fmt compile check_contracts
build: schema clippy test fmt compile check_contracts
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ The Neutron SDK is contained inside `packages` folder and consists of the follow
| Neutron Bindings | https://github.com/neutron-org/neutron-sdk/tree/main/packages/neutron-sdk/src/bindings | Structures and helper methods for interacting with Neutron blockchain |
| Neutron Sudo | https://github.com/neutron-org/neutron-sdk/tree/main/packages/neutron-sdk/src/sudo | Structures for Sudo Contract callbacks from Neutron blockchain |
| Neutron Errors | https://github.com/neutron-org/neutron-sdk/tree/main/packages/neutron-sdk/src/errors | Structures and helpers for Neutron specific error and result types |
| Neutron Proto Types | https://github.com/neutron-org/neutron-sdk/tree/main/packages/neutron-sdk/src/proto_types | Neutron specific protobuf types. |
| Neutron Stargate | https://github.com/neutron-org/neutron-sdk/tree/main/packages/neutron-sdk/src/stargate | Structures and helpers for interacting with Neutron via Stargate |

### Example Contracts

Expand Down
8 changes: 0 additions & 8 deletions build_proto.sh

This file was deleted.

6 changes: 3 additions & 3 deletions contracts/ibc_transfer/src/contract.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use cosmwasm_std::{
coin, entry_point, from_binary, Binary, CosmosMsg, Deps, DepsMut, Env, MessageInfo, Reply,
coin, entry_point, from_json, Binary, CosmosMsg, Deps, DepsMut, Env, MessageInfo, Reply,
Response, StdError, StdResult, SubMsg,
};
use cw2::set_contract_version;
Expand Down Expand Up @@ -112,8 +112,8 @@ fn msg_with_sudo_callback<C: Into<CosmosMsg<T>>, T>(
// and process this payload when an acknowledgement for the SubmitTx message is received in Sudo handler
fn prepare_sudo_payload(mut deps: DepsMut, _env: Env, msg: Reply) -> StdResult<Response> {
let payload = read_reply_payload(deps.storage, msg.id)?;
let resp: MsgIbcTransferResponse = from_binary(
&msg.result
let resp: MsgIbcTransferResponse = from_json(
msg.result
.into_result()
.map_err(StdError::generic_err)?
.data
Expand Down
10 changes: 5 additions & 5 deletions contracts/ibc_transfer/src/state.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use cosmwasm_std::{from_binary, to_vec, Binary, StdResult, Storage};
use cosmwasm_std::{from_json, to_json_vec, Binary, StdResult, Storage};
use cw_storage_plus::{Item, Map};

use crate::contract::SudoPayload;
Expand Down Expand Up @@ -28,13 +28,13 @@ pub fn get_next_id(store: &mut dyn Storage) -> StdResult<u64> {

pub fn save_reply_payload(store: &mut dyn Storage, payload: SudoPayload) -> StdResult<u64> {
let id = get_next_id(store)?;
REPLY_QUEUE_ID.save(store, id, &to_vec(&payload)?)?;
REPLY_QUEUE_ID.save(store, id, &to_json_vec(&payload)?)?;
Ok(id)
}

pub fn read_reply_payload(store: &dyn Storage, id: u64) -> StdResult<SudoPayload> {
let data = REPLY_QUEUE_ID.load(store, id)?;
from_binary(&Binary(data))
from_json(Binary(data))
}

/// SUDO_PAYLOAD - tmp storage for sudo handler payloads
Expand All @@ -50,7 +50,7 @@ pub fn save_sudo_payload(
seq_id: u64,
payload: SudoPayload,
) -> StdResult<()> {
SUDO_PAYLOAD.save(store, (channel_id, seq_id), &to_vec(&payload)?)
SUDO_PAYLOAD.save(store, (channel_id, seq_id), &to_json_vec(&payload)?)
}

pub fn read_sudo_payload(
Expand All @@ -59,5 +59,5 @@ pub fn read_sudo_payload(
seq_id: u64,
) -> StdResult<SudoPayload> {
let data = SUDO_PAYLOAD.load(store, (channel_id, seq_id))?;
from_binary(&Binary(data))
from_json(Binary(data))
}
30 changes: 15 additions & 15 deletions contracts/neutron_interchain_queries/src/contract.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ use cosmos_sdk_proto::cosmos::bank::v1beta1::MsgSend;
use cosmos_sdk_proto::cosmos::tx::v1beta1::{TxBody, TxRaw};
use cosmos_sdk_proto::traits::Message;
use cosmwasm_std::{
entry_point, to_binary, Binary, Deps, DepsMut, Env, MessageInfo, Response, StdError, StdResult,
Uint128,
entry_point, to_json_binary, Binary, Deps, DepsMut, Env, MessageInfo, Response, StdError,
StdResult, Uint128,
};
use cw2::set_contract_version;

Expand Down Expand Up @@ -250,27 +250,27 @@ pub fn remove_interchain_query(query_id: u64) -> NeutronResult<Response<NeutronM
pub fn query(deps: Deps<NeutronQuery>, env: Env, msg: QueryMsg) -> NeutronResult<Binary> {
match msg {
//TODO: check if query.result.height is too old (for all interchain queries)
QueryMsg::Balance { query_id } => Ok(to_binary(&query_balance(deps, env, query_id)?)?),
QueryMsg::Balance { query_id } => Ok(to_json_binary(&query_balance(deps, env, query_id)?)?),
QueryMsg::BankTotalSupply { query_id } => {
Ok(to_binary(&query_bank_total(deps, env, query_id)?)?)
Ok(to_json_binary(&query_bank_total(deps, env, query_id)?)?)
}
QueryMsg::DistributionFeePool { query_id } => Ok(to_binary(&query_distribution_fee_pool(
deps, env, query_id,
)?)?),
QueryMsg::StakingValidators { query_id } => {
Ok(to_binary(&query_staking_validators(deps, env, query_id)?)?)
}
QueryMsg::GovernmentProposals { query_id } => Ok(to_binary(&query_government_proposals(
QueryMsg::DistributionFeePool { query_id } => Ok(to_json_binary(
&query_distribution_fee_pool(deps, env, query_id)?,
)?),
QueryMsg::StakingValidators { query_id } => Ok(to_json_binary(&query_staking_validators(
deps, env, query_id,
)?)?),
QueryMsg::GovernmentProposals { query_id } => Ok(to_json_binary(
&query_government_proposals(deps, env, query_id)?,
)?),
QueryMsg::GetDelegations { query_id } => {
Ok(to_binary(&query_delegations(deps, env, query_id)?)?)
Ok(to_json_binary(&query_delegations(deps, env, query_id)?)?)
}
QueryMsg::Cw20Balance { query_id } => {
Ok(to_binary(&query_cw20_balance(deps, env, query_id)?)?)
Ok(to_json_binary(&query_cw20_balance(deps, env, query_id)?)?)
}
QueryMsg::GetRegisteredQuery { query_id } => {
Ok(to_binary(&get_registered_query(deps, query_id)?)?)
Ok(to_json_binary(&get_registered_query(deps, query_id)?)?)
}
QueryMsg::GetRecipientTxs { recipient } => query_recipient_txs(deps, recipient),
}
Expand All @@ -280,7 +280,7 @@ fn query_recipient_txs(deps: Deps<NeutronQuery>, recipient: String) -> NeutronRe
let txs = RECIPIENT_TXS
.load(deps.storage, &recipient)
.unwrap_or_default();
Ok(to_binary(&GetRecipientTxsResponse { transfers: txs })?)
Ok(to_json_binary(&GetRecipientTxsResponse { transfers: txs })?)
}

pub fn query_cw20_balance(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use std::marker::PhantomData;

use cosmwasm_std::testing::{MockApi, MockQuerier, MockStorage};
use cosmwasm_std::{
from_slice, Binary, Coin, ContractResult, CustomQuery, FullDelegation, OwnedDeps, Querier,
from_json, Binary, Coin, ContractResult, CustomQuery, FullDelegation, OwnedDeps, Querier,
QuerierResult, QueryRequest, SystemError, SystemResult, Uint128, Validator,
};
use schemars::JsonSchema;
Expand Down Expand Up @@ -43,7 +43,7 @@ pub struct WasmMockQuerier {

impl Querier for WasmMockQuerier {
fn raw_query(&self, bin_request: &[u8]) -> QuerierResult {
let request: QueryRequest<NeutronQuery> = match from_slice(bin_request) {
let request: QueryRequest<NeutronQuery> = match from_json(bin_request) {
Ok(v) => v,
Err(e) => {
return QuerierResult::Err(SystemError::InvalidRequest {
Expand Down
24 changes: 12 additions & 12 deletions contracts/neutron_interchain_queries/src/testing/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ use cosmos_sdk_proto::traits::Message;
use cosmos_sdk_proto::Any;
use cosmwasm_std::testing::{mock_env, mock_info, MockApi, MockStorage};
use cosmwasm_std::{
from_binary, to_binary, Addr, Binary, Coin, Decimal, Delegation, Env, MessageInfo, OwnedDeps,
StdError, Uint128,
from_json, to_json_binary, Addr, Binary, Coin, Decimal, Delegation, Env, MessageInfo,
OwnedDeps, StdError, Uint128,
};
use neutron_sdk::bindings::query::{
NeutronQuery, QueryRegisteredQueryResponse, QueryRegisteredQueryResultResponse,
Expand Down Expand Up @@ -257,7 +257,7 @@ fn test_query_balance() {
);
let query_balance = QueryMsg::Balance { query_id: 1 };
let resp: BalanceResponse =
from_binary(&query(deps.as_ref(), mock_env(), query_balance).unwrap()).unwrap();
from_json(query(deps.as_ref(), mock_env(), query_balance).unwrap()).unwrap();
assert_eq!(
resp,
BalanceResponse {
Expand Down Expand Up @@ -304,11 +304,11 @@ fn test_bank_total_supply_query() {

deps.querier.add_registered_queries(1, registered_query);
deps.querier
.add_query_response(1, to_binary(&total_supply_response).unwrap());
.add_query_response(1, to_json_binary(&total_supply_response).unwrap());
let bank_total_balance = QueryMsg::BankTotalSupply { query_id: 1 };

let resp: TotalSupplyResponse =
from_binary(&query(deps.as_ref(), mock_env(), bank_total_balance).unwrap()).unwrap();
from_json(query(deps.as_ref(), mock_env(), bank_total_balance).unwrap()).unwrap();
assert_eq!(
resp,
TotalSupplyResponse {
Expand Down Expand Up @@ -347,7 +347,7 @@ fn test_distribution_fee_pool_query() {
);
let fee_pool_balance = QueryMsg::DistributionFeePool { query_id: 1 };
let resp: FeePoolResponse =
from_binary(&query(deps.as_ref(), mock_env(), fee_pool_balance).unwrap()).unwrap();
from_json(query(deps.as_ref(), mock_env(), fee_pool_balance).unwrap()).unwrap();
assert_eq!(
resp,
FeePoolResponse {
Expand Down Expand Up @@ -393,11 +393,11 @@ fn test_gov_proposals_query() {

deps.querier.add_registered_queries(1, registered_query);
deps.querier
.add_query_response(1, to_binary(&proposals_response).unwrap());
.add_query_response(1, to_json_binary(&proposals_response).unwrap());

let government_proposal = QueryMsg::GovernmentProposals { query_id: 1 };
let resp: ProposalResponse =
from_binary(&query(deps.as_ref(), mock_env(), government_proposal).unwrap()).unwrap();
from_json(query(deps.as_ref(), mock_env(), government_proposal).unwrap()).unwrap();
assert_eq!(
resp,
ProposalResponse {
Expand Down Expand Up @@ -503,10 +503,10 @@ fn test_staking_validators_query() {

deps.querier.add_registered_queries(1, registered_query);
deps.querier
.add_query_response(1, to_binary(&validators_response).unwrap());
.add_query_response(1, to_json_binary(&validators_response).unwrap());
let staking_validators = QueryMsg::StakingValidators { query_id: 1 };
let resp: ValidatorResponse =
from_binary(&query(deps.as_ref(), mock_env(), staking_validators).unwrap()).unwrap();
from_json(query(deps.as_ref(), mock_env(), staking_validators).unwrap()).unwrap();
assert_eq!(
resp,
ValidatorResponse {
Expand Down Expand Up @@ -649,12 +649,12 @@ fn test_query_delegator_delegations() {
build_registered_query_response(1, QueryParam::Keys(keys.0), QueryType::KV, 987);

deps.querier
.add_query_response(1, to_binary(&delegations_response).unwrap());
.add_query_response(1, to_json_binary(&delegations_response).unwrap());
deps.querier.add_registered_queries(1, registered_query);

let query_delegations = QueryMsg::GetDelegations { query_id: 1 };
let resp: DelegatorDelegationsResponse =
from_binary(&query(deps.as_ref(), mock_env(), query_delegations).unwrap()).unwrap();
from_json(query(deps.as_ref(), mock_env(), query_delegations).unwrap()).unwrap();

assert_eq!(
resp,
Expand Down
32 changes: 30 additions & 2 deletions contracts/neutron_interchain_txs/schema/execute_msg.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,21 @@
"type": "object",
"required": [
"connection_id",
"interchain_account_id"
"interchain_account_id",
"register_fee"
],
"properties": {
"connection_id": {
"type": "string"
},
"interchain_account_id": {
"type": "string"
},
"register_fee": {
"type": "array",
"items": {
"$ref": "#/definitions/Coin"
}
}
}
}
Expand Down Expand Up @@ -110,5 +117,26 @@
},
"additionalProperties": false
}
]
],
"definitions": {
"Coin": {
"type": "object",
"required": [
"amount",
"denom"
],
"properties": {
"amount": {
"$ref": "#/definitions/Uint128"
},
"denom": {
"type": "string"
}
}
},
"Uint128": {
"description": "A thin wrapper around u128 that is using strings for JSON encoding/decoding, such that the full u128 range can be used for clients that convert JSON numbers to floats, like JavaScript and jq.\n\n# Examples\n\nUse `from` to create instances of this and `u128` to get the value out:\n\n``` # use cosmwasm_std::Uint128; let a = Uint128::from(123u128); assert_eq!(a.u128(), 123);\n\nlet b = Uint128::from(42u64); assert_eq!(b.u128(), 42);\n\nlet c = Uint128::from(70u32); assert_eq!(c.u128(), 70); ```",
"type": "string"
}
}
}
Loading
Loading