Skip to content

Commit

Permalink
Update sdk to 0.38.2
Browse files Browse the repository at this point in the history
  • Loading branch information
Lbqds committed Apr 18, 2024
1 parent 05758e4 commit 233b00f
Show file tree
Hide file tree
Showing 7 changed files with 2,685 additions and 2,827 deletions.
2 changes: 1 addition & 1 deletion .project.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"fullNodeVersion": "v2.3.5",
"fullNodeVersion": "v2.12.0",
"compilerOptionsUsed": {
"ignoreUnusedConstantsWarnings": false,
"ignoreUnusedVariablesWarnings": false,
Expand Down
2 changes: 1 addition & 1 deletion artifacts/TokenFaucet.ral.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "v2.3.5",
"version": "v2.12.0",
"name": "TokenFaucet",
"bytecode": "060609121b4024402d404a010000000102ce0002010000000102ce0102010000000102ce0202010000000102ce0302010000000102a0000201020101001116000e320c7bb4b11600aba00016002ba10005b416005f",
"codeHash": "3f02a0d23545568bc3face788c0202eda4244e2de567e8df482cb7f1ff611d52",
Expand Down
4 changes: 2 additions & 2 deletions artifacts/Withdraw.ral.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "v2.3.5",
"version": "v2.12.0",
"name": "Withdraw",
"bytecodeTemplate": "01010300000005{1}0d0c{0}0105",
"fieldsSig": {
Expand All @@ -8,7 +8,7 @@
"amount"
],
"types": [
"ByteVec",
"TokenFaucet",
"U256"
],
"isMutable": [
Expand Down
33 changes: 21 additions & 12 deletions artifacts/ts/TokenFaucet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ import {
fetchContractState,
ContractInstance,
getContractEventsCurrentCount,
TestContractParamsWithoutMaps,
TestContractResultWithoutMaps,
} from "@alephium/web3";
import { default as TokenFaucetContractJson } from "../TokenFaucet.ral.json";
import { getContractByCodeHash } from "./contracts";
Expand Down Expand Up @@ -81,6 +83,10 @@ class Factory extends ContractFactory<
TokenFaucetInstance,
TokenFaucetTypes.Fields
> {
getInitialFieldsWithDefaultValues() {
return this.contract.getInitialFieldsWithDefaultValues() as TokenFaucetTypes.Fields;
}

eventIndex = { Withdraw: 0 };
consts = { ErrorCodes: { InvalidWithdrawAmount: BigInt(0) } };

Expand All @@ -91,47 +97,50 @@ class Factory extends ContractFactory<
tests = {
getSymbol: async (
params: Omit<
TestContractParams<TokenFaucetTypes.Fields, never>,
TestContractParamsWithoutMaps<TokenFaucetTypes.Fields, never>,
"testArgs"
>
): Promise<TestContractResult<HexString>> => {
): Promise<TestContractResultWithoutMaps<HexString>> => {
return testMethod(this, "getSymbol", params);
},
getName: async (
params: Omit<
TestContractParams<TokenFaucetTypes.Fields, never>,
TestContractParamsWithoutMaps<TokenFaucetTypes.Fields, never>,
"testArgs"
>
): Promise<TestContractResult<HexString>> => {
): Promise<TestContractResultWithoutMaps<HexString>> => {
return testMethod(this, "getName", params);
},
getDecimals: async (
params: Omit<
TestContractParams<TokenFaucetTypes.Fields, never>,
TestContractParamsWithoutMaps<TokenFaucetTypes.Fields, never>,
"testArgs"
>
): Promise<TestContractResult<bigint>> => {
): Promise<TestContractResultWithoutMaps<bigint>> => {
return testMethod(this, "getDecimals", params);
},
getTotalSupply: async (
params: Omit<
TestContractParams<TokenFaucetTypes.Fields, never>,
TestContractParamsWithoutMaps<TokenFaucetTypes.Fields, never>,
"testArgs"
>
): Promise<TestContractResult<bigint>> => {
): Promise<TestContractResultWithoutMaps<bigint>> => {
return testMethod(this, "getTotalSupply", params);
},
balance: async (
params: Omit<
TestContractParams<TokenFaucetTypes.Fields, never>,
TestContractParamsWithoutMaps<TokenFaucetTypes.Fields, never>,
"testArgs"
>
): Promise<TestContractResult<bigint>> => {
): Promise<TestContractResultWithoutMaps<bigint>> => {
return testMethod(this, "balance", params);
},
withdraw: async (
params: TestContractParams<TokenFaucetTypes.Fields, { amount: bigint }>
): Promise<TestContractResult<null>> => {
params: TestContractParamsWithoutMaps<
TokenFaucetTypes.Fields,
{ amount: bigint }
>
): Promise<TestContractResultWithoutMaps<null>> => {
return testMethod(this, "withdraw", params);
},
};
Expand Down
2 changes: 1 addition & 1 deletion artifacts/ts/scripts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ import { default as WithdrawScriptJson } from "../Withdraw.ral.json";
export const Withdraw = new ExecutableScript<{
token: HexString;
amount: bigint;
}>(Script.fromJson(WithdrawScriptJson));
}>(Script.fromJson(WithdrawScriptJson, ""));
Loading

0 comments on commit 233b00f

Please sign in to comment.