-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
breaking: wip: fix(namada): switching block/tx to bigint
- Loading branch information
Showing
14 changed files
with
212 additions
and
256 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,46 +1,41 @@ | ||
import { Block, Batch } from '@hackbg/fadroma' | ||
import { CWError as Error } from './cw-base' | ||
import { Chain } from '@hackbg/fadroma' | ||
import { Transaction } from '@hackbg/fadroma' | ||
import type { CWChain, CWConnection } from './cw-connection' | ||
import type { CWAgent } from './cw-identity' | ||
|
||
type CWBlockParameters = | ||
ConstructorParameters<typeof Block>[0] & Partial<Pick<CWBlock, 'rawTransactions'>> | ||
|
||
export class CWBlock extends Block { | ||
constructor ( | ||
properties: ConstructorParameters<typeof Block>[0] & Partial<Pick<CWBlock, 'rawTransactions'>> | ||
) { | ||
super(properties) | ||
if (properties.rawTransactions) { | ||
this.rawTransactions = properties.rawTransactions | ||
} | ||
constructor (props: CWBlockParameters) { | ||
super(props) | ||
this.rawTransactions = props?.rawTransactions | ||
} | ||
/** Undecoded transactions. */ | ||
rawTransactions?: Uint8Array[] | ||
readonly rawTransactions?: Uint8Array[] | ||
} | ||
|
||
/** Transaction batch for CosmWasm-enabled chains. */ | ||
export class CWBatch extends Batch { | ||
declare agent: CWAgent | ||
|
||
upload ( | ||
code: Parameters<Batch["upload"]>[0], | ||
options: Parameters<Batch["upload"]>[1], | ||
) { | ||
upload (...args: Parameters<Batch["upload"]>) { | ||
throw new Error("CWBatch#upload: not implemented") | ||
return this | ||
} | ||
instantiate ( | ||
code: Parameters<Batch["instantiate"]>[0], | ||
options: Parameters<Batch["instantiate"]>[1] | ||
) { | ||
instantiate (...args: Parameters<Batch["instantiate"]>) { | ||
throw new Error("CWBatch#instantiate: not implemented") | ||
return this | ||
} | ||
execute ( | ||
contract: Parameters<Batch["execute"]>[0], | ||
options: Parameters<Batch["execute"]>[1] | ||
) { | ||
execute (...args: Parameters<Batch["execute"]>) { | ||
throw new Error("CWBatch#execute: not implemented") | ||
return this | ||
} | ||
async submit () {} | ||
async submit () { | ||
throw new Error("CWBatch#submit: not implemented") | ||
} | ||
} | ||
|
||
export class CWTransaction extends Transaction {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.